diff options
40 files changed, 238 insertions, 238 deletions
diff --git a/lib/Activity/Listener.php b/lib/Activity/Listener.php index 65d98bbed..78f62dad1 100644 --- a/lib/Activity/Listener.php +++ b/lib/Activity/Listener.php @@ -124,7 +124,7 @@ class Listener { $message = 'call_ended'; if ((\count($userIds) + $numGuests) === 1) { - if ($room->getType() !== Room::ONE_TO_ONE_CALL) { + if ($room->getType() !== Room::TYPE_ONE_TO_ONE) { // Single user pinged or guests only => no summary/activity $room->resetActiveSince(); return false; diff --git a/lib/Activity/Provider/Base.php b/lib/Activity/Provider/Base.php index a61a16f01..b1803ceaf 100644 --- a/lib/Activity/Provider/Base.php +++ b/lib/Activity/Provider/Base.php @@ -110,13 +110,13 @@ abstract class Base implements IProvider { protected function getRoom(Room $room, string $userId): array { switch ($room->getType()) { - case Room::ONE_TO_ONE_CALL: + case Room::TYPE_ONE_TO_ONE: $stringType = 'one2one'; break; - case Room::GROUP_CALL: + case Room::TYPE_GROUP: $stringType = 'group'; break; - case Room::PUBLIC_CALL: + case Room::TYPE_PUBLIC: default: $stringType = 'public'; break; @@ -136,7 +136,7 @@ abstract class Base implements IProvider { 'type' => 'call', 'id' => $roomId, 'name' => $l->t('a conversation'), - 'call-type' => Room::UNKNOWN_CALL, + 'call-type' => Room::TYPE_UNKNOWN, ]; } diff --git a/lib/Chat/AutoComplete/SearchPlugin.php b/lib/Chat/AutoComplete/SearchPlugin.php index 347593269..aed0b589c 100644 --- a/lib/Chat/AutoComplete/SearchPlugin.php +++ b/lib/Chat/AutoComplete/SearchPlugin.php @@ -93,7 +93,7 @@ class SearchPlugin implements ISearchPlugin { } $userIds = $guestAttendees = []; - if ($this->room->getType() === Room::ONE_TO_ONE_CALL) { + if ($this->room->getType() === Room::TYPE_ONE_TO_ONE) { // Add potential leavers of one-to-one rooms again. $participants = json_decode($this->room->getName(), true); foreach ($participants as $userId) { diff --git a/lib/Chat/Notifier.php b/lib/Chat/Notifier.php index deb8eb5f5..10382dfd6 100644 --- a/lib/Chat/Notifier.php +++ b/lib/Chat/Notifier.php @@ -184,7 +184,7 @@ class Notifier { } // Also notify default participants in one2one chats or when the admin default is "always" - if ($this->getDefaultGroupNotification() === Participant::NOTIFY_ALWAYS || $chat->getType() === Room::ONE_TO_ONE_CALL) { + if ($this->getDefaultGroupNotification() === Participant::NOTIFY_ALWAYS || $chat->getType() === Room::TYPE_ONE_TO_ONE) { $participants = $this->participantService->getParticipantsByNotificationLevel($chat, Participant::NOTIFY_DEFAULT); foreach ($participants as $participant) { if (!$this->shouldParticipantBeNotified($participant, $comment, $alreadyNotifiedUsers)) { @@ -335,7 +335,7 @@ class Notifier { $participant = $room->getParticipant($userId, false); $notificationLevel = $participant->getAttendee()->getNotificationLevel(); if ($notificationLevel === Participant::NOTIFY_DEFAULT) { - if ($room->getType() === Room::ONE_TO_ONE_CALL) { + if ($room->getType() === Room::TYPE_ONE_TO_ONE) { $notificationLevel = Participant::NOTIFY_ALWAYS; } else { $notificationLevel = $this->getDefaultGroupNotification(); diff --git a/lib/Chat/Parser/UserMention.php b/lib/Chat/Parser/UserMention.php index 269c6f20e..743fb2caa 100644 --- a/lib/Chat/Parser/UserMention.php +++ b/lib/Chat/Parser/UserMention.php @@ -174,11 +174,11 @@ class UserMention { */ protected function getRoomType(Room $room): string { switch ($room->getType()) { - case Room::ONE_TO_ONE_CALL: + case Room::TYPE_ONE_TO_ONE: return 'one2one'; - case Room::GROUP_CALL: + case Room::TYPE_GROUP: return 'group'; - case Room::PUBLIC_CALL: + case Room::TYPE_PUBLIC: return 'public'; default: throw new \InvalidArgumentException('Unknown room type'); diff --git a/lib/Chat/SystemMessage/Listener.php b/lib/Chat/SystemMessage/Listener.php index 67eb04c1c..31f5a4ba6 100644 --- a/lib/Chat/SystemMessage/Listener.php +++ b/lib/Chat/SystemMessage/Listener.php @@ -159,15 +159,15 @@ class Listener implements IEventListener { $dispatcher->addListener(Room::EVENT_AFTER_TYPE_SET, static function (ModifyRoomEvent $event) { $room = $event->getRoom(); - if ($event->getOldValue() === Room::ONE_TO_ONE_CALL) { + if ($event->getOldValue() === Room::TYPE_ONE_TO_ONE) { return; } - if ($event->getNewValue() === Room::PUBLIC_CALL) { + if ($event->getNewValue() === Room::TYPE_PUBLIC) { /** @var self $listener */ $listener = \OC::$server->query(self::class); $listener->sendSystemMessage($room, 'guests_allowed'); - } elseif ($event->getNewValue() === Room::GROUP_CALL) { + } elseif ($event->getNewValue() === Room::TYPE_GROUP) { /** @var self $listener */ $listener = \OC::$server->query(self::class); $listener->sendSystemMessage($room, 'guests_disallowed'); @@ -176,7 +176,7 @@ class Listener implements IEventListener { $dispatcher->addListener(Room::EVENT_AFTER_READONLY_SET, static function (ModifyRoomEvent $event) { $room = $event->getRoom(); - if ($room->getType() === Room::CHANGELOG_CONVERSATION) { + if ($room->getType() === Room::TYPE_CHANGELOG) { return; } @@ -224,7 +224,7 @@ class Listener implements IEventListener { $dispatcher->addListener(Room::EVENT_AFTER_USERS_ADD, static function (AddParticipantsEvent $event) { $room = $event->getRoom(); - if ($room->getType() === Room::ONE_TO_ONE_CALL) { + if ($room->getType() === Room::TYPE_ONE_TO_ONE) { return; } @@ -260,7 +260,7 @@ class Listener implements IEventListener { $dispatcher->addListener(Room::EVENT_AFTER_USER_REMOVE, static function (RemoveUserEvent $event) { $room = $event->getRoom(); - if ($room->getType() === Room::ONE_TO_ONE_CALL) { + if ($room->getType() === Room::TYPE_ONE_TO_ONE) { return; } diff --git a/lib/Collaboration/Resources/ConversationProvider.php b/lib/Collaboration/Resources/ConversationProvider.php index c2ed1ed02..3c30b1428 100644 --- a/lib/Collaboration/Resources/ConversationProvider.php +++ b/lib/Collaboration/Resources/ConversationProvider.php @@ -61,7 +61,7 @@ class ConversationProvider implements IProvider { $iconURL = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('spreed', 'app-dark.svg')); /** * Disabled for now, because it would show a square avatar - * if ($room->getType() === Room::ONE_TO_ONE_CALL) { + * if ($room->getType() === Room::TYPE_ONE_TO_ONE) { * $iconURL = $this->urlGenerator->linkToRouteAbsolute('core.avatar.getAvatar', ['userId' => 'admin', 'size' => 32]); * } */ @@ -113,11 +113,11 @@ class ConversationProvider implements IProvider { */ protected function getRoomType(Room $room): string { switch ($room->getType()) { - case Room::ONE_TO_ONE_CALL: + case Room::TYPE_ONE_TO_ONE: return 'one2one'; - case Room::GROUP_CALL: + case Room::TYPE_GROUP: return 'group'; - case Room::PUBLIC_CALL: + case Room::TYPE_PUBLIC: return 'public'; default: throw new \InvalidArgumentException('Unknown room type'); diff --git a/lib/Command/Room/Add.php b/lib/Command/Room/Add.php index 556b9fba4..377741b37 100644 --- a/lib/Command/Room/Add.php +++ b/lib/Command/Room/Add.php @@ -71,7 +71,7 @@ class Add extends Base { return 1; } - if (!in_array($room->getType(), [Room::GROUP_CALL, Room::PUBLIC_CALL], true)) { + if (!in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { $output->writeln('<error>Room is no group call.</error>'); return 1; } diff --git a/lib/Command/Room/Create.php b/lib/Command/Room/Create.php index 8e992aaf3..4b5208e2e 100644 --- a/lib/Command/Room/Create.php +++ b/lib/Command/Room/Create.php @@ -120,7 +120,7 @@ class Create extends Base { return 1; } - $roomType = $public ? Room::PUBLIC_CALL : Room::GROUP_CALL; + $roomType = $public ? Room::TYPE_PUBLIC : Room::TYPE_GROUP; try { $room = $this->roomService->createConversation($roomType, $name); } catch (InvalidArgumentException $e) { diff --git a/lib/Command/Room/Delete.php b/lib/Command/Room/Delete.php index 7135277dd..3f5907415 100644 --- a/lib/Command/Room/Delete.php +++ b/lib/Command/Room/Delete.php @@ -57,7 +57,7 @@ class Delete extends Base { return 1; } - if (!in_array($room->getType(), [Room::GROUP_CALL, Room::PUBLIC_CALL], true)) { + if (!in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { $output->writeln('<error>Room is no group call.</error>'); return 1; } diff --git a/lib/Command/Room/Demote.php b/lib/Command/Room/Demote.php index a7f6a91d8..a150529af 100644 --- a/lib/Command/Room/Demote.php +++ b/lib/Command/Room/Demote.php @@ -63,7 +63,7 @@ class Demote extends Base { return 1; } - if (!in_array($room->getType(), [Room::GROUP_CALL, Room::PUBLIC_CALL], true)) { + if (!in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { $output->writeln('<error>Room is no group call.</error>'); return 1; } diff --git a/lib/Command/Room/Promote.php b/lib/Command/Room/Promote.php index 945dff62e..72088457b 100644 --- a/lib/Command/Room/Promote.php +++ b/lib/Command/Room/Promote.php @@ -63,7 +63,7 @@ class Promote extends Base { return 1; } - if (!in_array($room->getType(), [Room::GROUP_CALL, Room::PUBLIC_CALL], true)) { + if (!in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) { $output->writeln('<error>Room is no group call.</error>'); return 1; } diff --git a/lib/Command/Room/Remove.php b/lib/Command/Room/Remove.php index 4424307e0..38a7ca4af 100644 --- a/lib/Command/Room/Remove.php +++ b/lib/Command/Room/Remove.php @@ -63,7 +63,7 @@ class Remove extends Base { return 1; } - if (!in_array($room->getType(), [Room::GROUP_CALL, Room::PUBLIC_CALL], true)) { + if (!in_array($room->getType(), [Roo |