зеркало из https://github.com/nextcloud/spreed.git
Do not allow to share files into read-only conversations
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
670a0f90fd
Коммит
e9335698fb
|
@ -59,6 +59,11 @@ class RoomPlugin implements ISearchPlugin {
|
|||
|
||||
$rooms = $this->manager->getRoomsForParticipant($userId);
|
||||
foreach ($rooms as $room) {
|
||||
if ($room->getReadOnly() === Room::READ_ONLY) {
|
||||
// Can not add new shares to read-only rooms
|
||||
continue;
|
||||
}
|
||||
|
||||
if (stripos($room->getDisplayName($userId), $search) !== false) {
|
||||
$item = $this->roomToSearchResultItem($room, $userId);
|
||||
|
||||
|
|
|
@ -152,6 +152,10 @@ class RoomShareProvider implements IShareProvider {
|
|||
throw new GenericShareException('Room not found', $this->l->t('Conversation not found'), 404);
|
||||
}
|
||||
|
||||
if ($room->getReadOnly() === Room::READ_ONLY) {
|
||||
throw new GenericShareException('Room not found', $this->l->t('Conversation not found'), 404);
|
||||
}
|
||||
|
||||
try {
|
||||
$room->getParticipant($share->getSharedBy());
|
||||
} catch (ParticipantNotFoundException $e) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче