mirror of
https://github.com/nextcloud/spreed.git
synced 2025-12-18 05:20:50 +01:00
Replace old type constants with new ones
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
8c18fc16cb
commit
9e8d94d58f
40 changed files with 238 additions and 238 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) {
|
||||
$output->writeln('<error>Room is no group call.</error>');
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,11 +127,11 @@ trait TRoomCommand {
|
|||
* @throws InvalidArgumentException
|
||||
*/
|
||||
protected function setRoomPublic(Room $room, bool $public): void {
|
||||
if ($public === ($room->getType() === Room::PUBLIC_CALL)) {
|
||||
if ($public === ($room->getType() === Room::TYPE_PUBLIC)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$room->setType($public ? Room::PUBLIC_CALL : Room::GROUP_CALL)) {
|
||||
if (!$room->setType($public ? Room::TYPE_PUBLIC : Room::TYPE_GROUP)) {
|
||||
throw new InvalidArgumentException('Unable to change room type.');
|
||||
}
|
||||
}
|
||||
|
|
@ -179,7 +179,7 @@ trait TRoomCommand {
|
|||
return;
|
||||
}
|
||||
|
||||
if (($password !== '') && ($room->getType() !== Room::PUBLIC_CALL)) {
|
||||
if (($password !== '') && ($room->getType() !== Room::TYPE_PUBLIC)) {
|
||||
throw new InvalidArgumentException('Unable to add password protection to private room.');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class Update 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ class ChatController extends AEnvironmentAwareController {
|
|||
$isOwnMessage = $isOwnMessage || ($message->getActorType() === Attendee::ACTOR_BRIDGED && $attendee->getActorId() === MatterbridgeManager::BRIDGE_BOT_USERID);
|
||||
if (!$isOwnMessage
|
||||
&& (!$this->participant->hasModeratorPermissions(false)
|
||||
|| $this->room->getType() === Room::ONE_TO_ONE_CALL)) {
|
||||
|| $this->room->getType() === Room::TYPE_ONE_TO_ONE)) {
|
||||
// Actor is not a moderator or not the owner of the message
|
||||
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||
}
|
||||
|
|
@ -620,7 +620,7 @@ class ChatController extends AEnvironmentAwareController {
|
|||
public function clearHistory(): DataResponse {
|
||||
$attendee = $this->participant->getAttendee();
|
||||
if (!$this->participant->hasModeratorPermissions(false)
|
||||
|| $this->room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
|| $this->room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
// Actor is not a moderator or not the owner of the message
|
||||
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ class FilesIntegrationController extends OCSController {
|
|||
} catch (RoomNotFoundException $e) {
|
||||
$name = $node->getName();
|
||||
$name = $this->roomService->prepareConversationName($name);
|
||||
$room = $this->roomService->createConversation(Room::PUBLIC_CALL, $name, null, 'file', $fileId);
|
||||
$room = $this->roomService->createConversation(Room::TYPE_PUBLIC, $name, null, 'file', $fileId);
|
||||
}
|
||||
|
||||
return new DataResponse([
|
||||
|
|
@ -218,7 +218,7 @@ class FilesIntegrationController extends OCSController {
|
|||
} catch (RoomNotFoundException $e) {
|
||||
$name = $share->getNode()->getName();
|
||||
$name = $this->roomService->prepareConversationName($name);
|
||||
$room = $this->roomService->createConversation(Room::PUBLIC_CALL, $name, null, 'file', $fileId);
|
||||
$room = $this->roomService->createConversation(Room::TYPE_PUBLIC, $name, null, 'file', $fileId);
|
||||
}
|
||||
} catch (NotFoundException $e) {
|
||||
return new DataResponse([], Http::STATUS_NOT_FOUND);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ class PageController extends Controller {
|
|||
}
|
||||
|
||||
// If the room is not a public room, check if the user is in the participants
|
||||
if ($room->getType() !== Room::PUBLIC_CALL) {
|
||||
if ($room->getType() !== Room::TYPE_PUBLIC) {
|
||||
$this->manager->getRoomForUser($room->getId(), $this->userId);
|
||||
}
|
||||
} catch (RoomNotFoundException $e) {
|
||||
|
|
@ -243,7 +243,7 @@ class PageController extends Controller {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$response = $this->api->createRoom(Room::ONE_TO_ONE_CALL, $callUser);
|
||||
$response = $this->api->createRoom(Room::TYPE_ONE_TO_ONE, $callUser);
|
||||
if ($response->getStatus() === Http::STATUS_OK
|
||||
|| $response->getStatus() === Http::STATUS_CREATED) {
|
||||
$data = $response->getData();
|
||||
|
|
@ -284,7 +284,7 @@ class PageController extends Controller {
|
|||
protected function guestEnterRoom(string $token, string $password): Response {
|
||||
try {
|
||||
$room = $this->manager->getRoomByToken($token);
|
||||
if ($room->getType() !== Room::PUBLIC_CALL) {
|
||||
if ($room->getType() !== Room::TYPE_PUBLIC) {
|
||||
throw new RoomNotFoundException();
|
||||
}
|
||||
} catch (RoomNotFoundException $e) {
|
||||
|
|
@ -348,7 +348,7 @@ class PageController extends Controller {
|
|||
if ($this->userId === null) {
|
||||
try {
|
||||
$room = $this->manager->getRoomByToken($token);
|
||||
if ($room->getType() !== Room::PUBLIC_CALL) {
|
||||
if ($room->getType() !== Room::TYPE_PUBLIC) {
|
||||
throw new RoomNotFoundException();
|
||||
}
|
||||
return new RedirectResponse($this->url->linkToRoute('spreed.Page.showCall', ['token' => $token]));
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class PublicShareAuthController extends OCSController {
|
|||
$roomName = $this->roomService->prepareConversationName($roomName);
|
||||
|
||||
// Create the room
|
||||
$room = $this->roomService->createConversation(Room::PUBLIC_CALL, $roomName, $sharerUser, 'share:password', $shareToken);
|
||||
$room = $this->roomService->createConversation(Room::TYPE_PUBLIC, $roomName, $sharerUser, 'share:password', $shareToken);
|
||||
|
||||
$user = $this->userSession->getUser();
|
||||
$userId = $user instanceof IUser ? $user->getUID() : '';
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
&& $includeStatus
|
||||
&& $this->appManager->isEnabledForUser('user_status')) {
|
||||
$userIds = array_filter(array_map(function (Room $room) {
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$participants = json_decode($room->getName(), true);
|
||||
foreach ($participants as $participant) {
|
||||
if ($participant !== $this->userId) {
|
||||
|
|
@ -507,7 +507,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
if ($roomData['notificationLevel'] === Participant::NOTIFY_DEFAULT) {
|
||||
if ($currentParticipant->isGuest()) {
|
||||
$roomData['notificationLevel'] = Participant::NOTIFY_NEVER;
|
||||
} elseif ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
} elseif ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$roomData['notificationLevel'] = Participant::NOTIFY_ALWAYS;
|
||||
} else {
|
||||
$adminSetting = (int) $this->config->getAppValue('spreed', 'default_group_notification', Participant::NOTIFY_DEFAULT);
|
||||
|
|
@ -556,20 +556,20 @@ class RoomController extends AEnvironmentAwareController {
|
|||
$roomData['unreadMentionDirect'] = $lastMentionDirect !== 0 && $lastReadMessage < $lastMentionDirect;
|
||||
$roomData['lastReadMessage'] = $lastReadMessage;
|
||||
|
||||
$roomData['canDeleteConversation'] = $room->getType() !== Room::ONE_TO_ONE_CALL
|
||||
$roomData['canDeleteConversation'] = $room->getType() !== Room::TYPE_ONE_TO_ONE
|
||||
&& $currentParticipant->hasModeratorPermissions(false);
|
||||
$roomData['canLeaveConversation'] = true;
|
||||
$roomData['canEnableSIP'] =
|
||||
$this->talkConfig->isSIPConfigured()
|
||||
&& !preg_match(Room::SIP_INCOMPATIBLE_REGEX, $room->getToken())
|
||||
&& ($room->getType() === Room::GROUP_CALL || $room->getType() === Room::PUBLIC_CALL)
|
||||
&& ($room->getType() === Room::TYPE_GROUP || $room->getType() === Room::TYPE_PUBLIC)
|
||||
&& $currentParticipant->hasModeratorPermissions(false)
|
||||
&& $this->talkConfig->canUserEnableSIP($currentUser);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME This should not be done, but currently all the clients use it to get the avatar of the user …
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$participants = json_decode($room->getName(), true);
|
||||
foreach ($participants as $participant) {
|
||||
if ($participant !== $attendee->getActorId()) {
|
||||
|
|
@ -629,7 +629,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function createRoom(int $roomType, string $invite = '', string $roomName = '', string $source = ''): DataResponse {
|
||||
if ($roomType !== Room::ONE_TO_ONE_CALL) {
|
||||
if ($roomType !== Room::TYPE_ONE_TO_ONE) {
|
||||
/** @var IUser $user */
|
||||
$user = $this->userManager->get($this->userId);
|
||||
|
||||
|
|
@ -639,9 +639,9 @@ class RoomController extends AEnvironmentAwareController {
|
|||
}
|
||||
|
||||
switch ($roomType) {
|
||||
case Room::ONE_TO_ONE_CALL:
|
||||
case Room::TYPE_ONE_TO_ONE:
|
||||
return $this->createOneToOneRoom($invite);
|
||||
case Room::GROUP_CALL:
|
||||
case Room::TYPE_GROUP:
|
||||
if ($invite === '') {
|
||||
return $this->createEmptyRoom($roomName, false);
|
||||
}
|
||||
|
|
@ -649,7 +649,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
return $this->createCircleRoom($invite);
|
||||
}
|
||||
return $this->createGroupRoom($invite);
|
||||
case Room::PUBLIC_CALL:
|
||||
case Room::TYPE_PUBLIC:
|
||||
return $this->createEmptyRoom($roomName);
|
||||
}
|
||||
|
||||
|
|
@ -726,7 +726,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
|
||||
// Create the room
|
||||
$name = $this->roomService->prepareConversationName($targetGroup->getDisplayName());
|
||||
$room = $this->roomService->createConversation(Room::GROUP_CALL, $name, $currentUser);
|
||||
$room = $this->roomService->createConversation(Room::TYPE_GROUP, $name, $currentUser);
|
||||
$this->participantService->addGroup($room, $targetGroup);
|
||||
|
||||
return new DataResponse($this->formatRoom($room, $room->getParticipant($currentUser->getUID(), false)), Http::STATUS_CREATED);
|
||||
|
|
@ -758,7 +758,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
|
||||
// Create the room
|
||||
$name = $this->roomService->prepareConversationName($circle->getName());
|
||||
$room = $this->roomService->createConversation(Room::GROUP_CALL, $name, $currentUser);
|
||||
$room = $this->roomService->createConversation(Room::TYPE_GROUP, $name, $currentUser);
|
||||
$this->participantService->addCircle($room, $circle);
|
||||
|
||||
return new DataResponse($this->formatRoom($room, $room->getParticipant($currentUser->getUID(), false)), Http::STATUS_CREATED);
|
||||
|
|
@ -777,7 +777,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
return new DataResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
|
||||
$roomType = $public ? Room::PUBLIC_CALL : Room::GROUP_CALL;
|
||||
$roomType = $public ? Room::TYPE_PUBLIC : Room::TYPE_GROUP;
|
||||
|
||||
// Create the room
|
||||
try {
|
||||
|
|
@ -836,7 +836,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function renameRoom(string $roomName): DataResponse {
|
||||
if ($this->room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($this->room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
return new DataResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
@ -858,7 +858,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function setDescription(string $description): DataResponse {
|
||||
if ($this->room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($this->room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
return new DataResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
@ -878,7 +878,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function deleteRoom(): DataResponse {
|
||||
if ($this->room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($this->room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
return new DataResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
@ -1033,7 +1033,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function addParticipantToRoom(string $newParticipant, string $source = 'users'): DataResponse {
|
||||
if ($this->room->getType() === Room::ONE_TO_ONE_CALL || $this->room->getObjectType() === 'share:password') {
|
||||
if ($this->room->getType() === Room::TYPE_ONE_TO_ONE || $this->room->getObjectType() === 'share:password') {
|
||||
return new DataResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
@ -1088,7 +1088,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
$this->participantService->addCircle($this->room, $circle, $participants);
|
||||
} elseif ($source === 'emails') {
|
||||
$data = [];
|
||||
if ($this->room->setType(Room::PUBLIC_CALL)) {
|
||||
if ($this->room->setType(Room::TYPE_PUBLIC)) {
|
||||
$data = ['type' => $this->room->getType()];
|
||||
}
|
||||
|
||||
|
|
@ -1153,7 +1153,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
}
|
||||
|
||||
protected function removeSelfFromRoomLogic(Room $room, Participant $participant): DataResponse {
|
||||
if ($room->getType() !== Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() !== Room::TYPE_ONE_TO_ONE) {
|
||||
if ($participant->hasModeratorPermissions(false)
|
||||
&& $this->participantService->getNumberOfUsers($room) > 1
|
||||
&& $this->participantService->getNumberOfModerators($room) === 1) {
|
||||
|
|
@ -1161,7 +1161,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
}
|
||||
}
|
||||
|
||||
if ($room->getType() !== Room::CHANGELOG_CONVERSATION &&
|
||||
if ($room->getType() !== Room::TYPE_CHANGELOG &&
|
||||
$room->getObjectType() !== 'file' &&
|
||||
$this->participantService->getNumberOfUsers($room) === 1 &&
|
||||
\in_array($participant->getAttendee()->getParticipantType(), [
|
||||
|
|
@ -1202,7 +1202,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
return new DataResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
|
||||
if ($this->room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($this->room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
return new DataResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
@ -1225,7 +1225,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function makePublic(): DataResponse {
|
||||
if (!$this->room->setType(Room::PUBLIC_CALL)) {
|
||||
if (!$this->room->setType(Room::TYPE_PUBLIC)) {
|
||||
return new DataResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
@ -1239,7 +1239,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function makePrivate(): DataResponse {
|
||||
if (!$this->room->setType(Room::GROUP_CALL)) {
|
||||
if (!$this->room->setType(Room::TYPE_GROUP)) {
|
||||
return new DataResponse([], Http::STATUS_BAD_REQUEST);
|
||||
}
|
||||
|
||||
|
|
@ -1293,7 +1293,7 @@ class RoomController extends AEnvironmentAwareController {
|
|||
* @return DataResponse
|
||||
*/
|
||||
public function setPassword(string $password): DataResponse {
|
||||
if ($this->room->getType() !== Room::PUBLIC_CALL) {
|
||||
if ($this->room->getType() !== Room::TYPE_PUBLIC) {
|
||||
return new DataResponse([], Http::STATUS_FORBIDDEN);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class UserDeletedListener implements IEventListener {
|
|||
foreach ($leftRooms as $room) {
|
||||
// We are changing the room type and name so a potential follow up
|
||||
// user with the same user-id can not reopen the one-to-one conversation.
|
||||
$room->setType(Room::GROUP_CALL, true);
|
||||
$room->setType(Room::TYPE_GROUP, true);
|
||||
$room->setName($user->getDisplayName(), '');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ class Manager {
|
|||
$helper = new SelectHelper();
|
||||
$helper->selectRoomsTable($query);
|
||||
$query->from('talk_rooms', 'r')
|
||||
->where($query->expr()->eq('r.type', $query->createNamedParameter(Room::ONE_TO_ONE_CALL)))
|
||||
->where($query->expr()->eq('r.type', $query->createNamedParameter(Room::TYPE_ONE_TO_ONE)))
|
||||
->andWhere($query->expr()->like('r.name', $query->createNamedParameter('%' . $this->db->escapeLikeParameter(json_encode($userId)) . '%')));
|
||||
|
||||
$result = $query->execute();
|
||||
|
|
@ -424,7 +424,7 @@ class Manager {
|
|||
* @return Room[]
|
||||
*/
|
||||
public function getListedRoomsForUser(string $userId, string $term = ''): array {
|
||||
$allowedRoomTypes = [Room::GROUP_CALL, Room::PUBLIC_CALL];
|
||||
$allowedRoomTypes = [Room::TYPE_GROUP, Room::TYPE_PUBLIC];
|
||||
$allowedListedTypes = [Room::LISTABLE_ALL];
|
||||
if (!$this->isGuestUser($userId)) {
|
||||
$allowedListedTypes[] = Room::LISTABLE_USERS;
|
||||
|
|
@ -505,7 +505,7 @@ class Manager {
|
|||
$room->setParticipant($row['actor_id'], $this->createParticipantObject($room, $row));
|
||||
}
|
||||
|
||||
if ($userId === null && $room->getType() !== Room::PUBLIC_CALL) {
|
||||
if ($userId === null && $room->getType() !== Room::TYPE_PUBLIC) {
|
||||
throw new RoomNotFoundException();
|
||||
}
|
||||
|
||||
|
|
@ -576,7 +576,7 @@ class Manager {
|
|||
$room->setParticipant($row['actor_id'], $this->createParticipantObject($room, $row));
|
||||
}
|
||||
|
||||
if ($isSIPBridgeRequest || $room->getType() === Room::PUBLIC_CALL) {
|
||||
if ($isSIPBridgeRequest || $room->getType() === Room::TYPE_PUBLIC) {
|
||||
return $room;
|
||||
}
|
||||
|
||||
|
|
@ -800,7 +800,7 @@ class Manager {
|
|||
$participant = $this->createParticipantObject($room, $row);
|
||||
$room->setParticipant($row['actor_id'], $participant);
|
||||
|
||||
if ($room->getType() === Room::PUBLIC_CALL || !in_array($participant->getAttendee()->getParticipantType(), [Participant::GUEST, Participant::GUEST_MODERATOR, Participant::USER_SELF_JOINED], true)) {
|
||||
if ($room->getType() === Room::TYPE_PUBLIC || !in_array($participant->getAttendee()->getParticipantType(), [Participant::GUEST, Participant::GUEST_MODERATOR, Participant::USER_SELF_JOINED], true)) {
|
||||
return $room;
|
||||
}
|
||||
|
||||
|
|
@ -822,7 +822,7 @@ class Manager {
|
|||
$helper = new SelectHelper();
|
||||
$helper->selectRoomsTable($query);
|
||||
$query->from('talk_rooms', 'r')
|
||||
->where($query->expr()->eq('r.type', $query->createNamedParameter(Room::ONE_TO_ONE_CALL, IQueryBuilder::PARAM_INT)))
|
||||
->where($query->expr()->eq('r.type', $query->createNamedParameter(Room::TYPE_ONE_TO_ONE, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($query->expr()->eq('r.name', $query->createNamedParameter($name)));
|
||||
|
||||
$result = $query->execute();
|
||||
|
|
@ -852,7 +852,7 @@ class Manager {
|
|||
$helper = new SelectHelper();
|
||||
$helper->selectRoomsTable($query);
|
||||
$query->from('talk_rooms', 'r')
|
||||
->where($query->expr()->eq('r.type', $query->createNamedParameter(Room::CHANGELOG_CONVERSATION, IQueryBuilder::PARAM_INT)))
|
||||
->where($query->expr()->eq('r.type', $query->createNamedParameter(Room::TYPE_CHANGELOG, IQueryBuilder::PARAM_INT)))
|
||||
->andWhere($query->expr()->eq('r.name', $query->createNamedParameter($userId)));
|
||||
|
||||
$result = $query->execute();
|
||||
|
|
@ -860,7 +860,7 @@ class Manager {
|
|||
$result->closeCursor();
|
||||
|
||||
if ($row === false) {
|
||||
$room = $this->createRoom(Room::CHANGELOG_CONVERSATION, $userId);
|
||||
$room = $this->createRoom(Room::TYPE_CHANGELOG, $userId);
|
||||
$room->setReadOnly(Room::READ_ONLY);
|
||||
$room->setListable(Room::LISTABLE_NONE);
|
||||
|
||||
|
|
@ -952,20 +952,20 @@ class Manager {
|
|||
if ($room->getObjectType() === 'share:password') {
|
||||
return $this->l->t('Password request: %s', [$room->getName()]);
|
||||
}
|
||||
if ($room->getType() === Room::CHANGELOG_CONVERSATION) {
|
||||
if ($room->getType() === Room::TYPE_CHANGELOG) {
|
||||
return $this->l->t('Talk updates ✅');
|
||||
}
|
||||
if ($userId === '' && $room->getType() !== Room::PUBLIC_CALL) {
|
||||
if ($userId === '' && $room->getType() !== Room::TYPE_PUBLIC) {
|
||||
return $this->l->t('Private conversation');
|
||||
}
|
||||
|
||||
|
||||
if ($room->getType() !== Room::ONE_TO_ONE_CALL && $room->getName() === '') {
|
||||
if ($room->getType() !== Room::TYPE_ONE_TO_ONE && $room->getName() === '') {
|
||||
$room->setName($this->getRoomNameByParticipants($room));
|
||||
}
|
||||
|
||||
// Set the room name to the other participant for one-to-one rooms
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
if ($userId === '') {
|
||||
return $this->l->t('Private conversation');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ class Version2001Date20170707115443 extends SimpleMigrationStep {
|
|||
|
||||
$query->select('id')
|
||||
->from('spreedme_rooms')
|
||||
->where($query->expr()->eq('type', $query->createNamedParameter(Room::ONE_TO_ONE_CALL)));
|
||||
->where($query->expr()->eq('type', $query->createNamedParameter(Room::TYPE_ONE_TO_ONE)));
|
||||
$result = $query->execute();
|
||||
|
||||
$one2oneRooms = [];
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ class Notifier implements INotifier {
|
|||
'id' => $message->getComment()->getId(),
|
||||
'name' => $shortenMessage,
|
||||
];
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$subject = "{user}\n{message}";
|
||||
} elseif ($richSubjectUser) {
|
||||
$subject = $l->t('{user} in {call}') . "\n{message}";
|
||||
|
|
@ -424,7 +424,7 @@ class Notifier implements INotifier {
|
|||
}
|
||||
}
|
||||
} elseif ($notification->getSubject() === 'chat') {
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$subject = $l->t('{user} sent you a private message');
|
||||
} elseif ($richSubjectUser) {
|
||||
$subject = $l->t('{user} sent a message in conversation {call}');
|
||||
|
|
@ -439,7 +439,7 @@ class Notifier implements INotifier {
|
|||
}
|
||||
}
|
||||
} elseif ($notification->getSubject() === 'reply') {
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$subject = $l->t('{user} replied to your private message');
|
||||
} elseif ($richSubjectUser) {
|
||||
$subject = $l->t('{user} replied to your message in conversation {call}');
|
||||
|
|
@ -453,7 +453,7 @@ class Notifier implements INotifier {
|
|||
$subject = $l->t('A guest replied to your message in conversation {call}');
|
||||
}
|
||||
}
|
||||
} elseif ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
} elseif ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$subject = $l->t('{user} mentioned you in a private conversation');
|
||||
} elseif ($richSubjectUser) {
|
||||
$subject = $l->t('{user} mentioned you in conversation {call}');
|
||||
|
|
@ -512,11 +512,11 @@ class Notifier implements INotifier {
|
|||
*/
|
||||
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');
|
||||
|
|
@ -545,7 +545,7 @@ class Notifier implements INotifier {
|
|||
}
|
||||
|
||||
$roomName = $room->getDisplayName($notification->getUser());
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$subject = $l->t('{user} invited you to a private conversation');
|
||||
if ($this->participantService->hasActiveSessionsInCall($room)) {
|
||||
$notification = $this->addActionButton($notification, $l->t('Join call'));
|
||||
|
|
@ -570,7 +570,7 @@ class Notifier implements INotifier {
|
|||
],
|
||||
]
|
||||
);
|
||||
} elseif (\in_array($room->getType(), [Room::GROUP_CALL, Room::PUBLIC_CALL], true)) {
|
||||
} elseif (\in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) {
|
||||
$subject = $l->t('{user} invited you to a group conversation: {call}');
|
||||
if ($this->participantService->hasActiveSessionsInCall($room)) {
|
||||
$notification = $this->addActionButton($notification, $l->t('Join call'));
|
||||
|
|
@ -616,7 +616,7 @@ class Notifier implements INotifier {
|
|||
}
|
||||
|
||||
$roomName = $room->getDisplayName($notification->getUser());
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$parameters = $notification->getSubjectParameters();
|
||||
$calleeId = $parameters['callee'];
|
||||
$user = $this->userManager->get($calleeId);
|
||||
|
|
@ -649,7 +649,7 @@ class Notifier implements INotifier {
|
|||
} else {
|
||||
throw new AlreadyProcessedException();
|
||||
}
|
||||
} elseif (\in_array($room->getType(), [Room::GROUP_CALL, Room::PUBLIC_CALL], true)) {
|
||||
} elseif (\in_array($room->getType(), [Room::TYPE_GROUP, Room::TYPE_PUBLIC], true)) {
|
||||
if ($this->notificationManager->isPreparingPushNotification() || $this->participantService->hasActiveSessionsInCall($room)) {
|
||||
$notification = $this->addActionButton($notification, $l->t('Join call'));
|
||||
$subject = $l->t('A group call has started in {call}');
|
||||
|
|
|
|||
30
lib/Room.php
30
lib/Room.php
|
|
@ -313,7 +313,7 @@ class Room {
|
|||
}
|
||||
|
||||
public function getName(): string {
|
||||
if ($this->type === self::ONE_TO_ONE_CALL) {
|
||||
if ($this->type === self::TYPE_ONE_TO_ONE) {
|
||||
if ($this->name === '') {
|
||||
// TODO use DI
|
||||
$participantService = \OC::$server->get(ParticipantService::class);
|
||||
|
|
@ -670,7 +670,7 @@ class Room {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $newName Currently it is only allowed to rename: self::GROUP_CALL, self::PUBLIC_CALL
|
||||
* @param string $newName Currently it is only allowed to rename: self::TYPE_GROUP, self::TYPE_PUBLIC
|
||||
* @param string|null $oldName
|
||||
* @return bool True when the change was valid, false otherwise
|
||||
*/
|
||||
|
|
@ -728,11 +728,11 @@ class Room {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string $password Currently it is only allowed to have a password for Room::PUBLIC_CALL
|
||||
* @param string $password Currently it is only allowed to have a password for Room::TYPE_PUBLIC
|
||||
* @return bool True when the change was valid, false otherwise
|
||||
*/
|
||||
public function setPassword(string $password): bool {
|
||||
if ($this->getType() !== self::PUBLIC_CALL) {
|
||||
if ($this->getType() !== self::TYPE_PUBLIC) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -776,7 +776,7 @@ class Room {
|
|||
* @return bool
|
||||
*/
|
||||
public function setActiveSince(\DateTime $since, int $callFlag, bool $isGuest): bool {
|
||||
if ($isGuest && $this->getType() === self::PUBLIC_CALL) {
|
||||
if ($isGuest && $this->getType() === self::TYPE_PUBLIC) {
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->update('talk_rooms')
|
||||
->set('active_guests', $query->createFunction($query->getColumnName('active_guests') . ' + 1'))
|
||||
|
|
@ -856,7 +856,7 @@ class Room {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param int $newType Currently it is only allowed to change between `self::GROUP_CALL` and `self::PUBLIC_CALL`
|
||||
* @param int $newType Currently it is only allowed to change between `self::TYPE_GROUP` and `self::TYPE_PUBLIC`
|
||||
* @return bool True when the change was valid, false otherwise
|
||||
*/
|
||||
public function setType(int $newType, bool $allowSwitchingOneToOne = false): bool {
|
||||
|
|
@ -864,11 +864,11 @@ class Room {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!$allowSwitchingOneToOne && $this->getType() === self::ONE_TO_ONE_CALL) {
|
||||
if (!$allowSwitchingOneToOne && $this->getType() === self::TYPE_ONE_TO_ONE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!in_array($newType, [self::GROUP_CALL, self::PUBLIC_CALL], true)) {
|
||||
if (!in_array($newType, [self::TYPE_GROUP, self::TYPE_PUBLIC], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -885,7 +885,7 @@ class Room {
|
|||
|
||||
$this->type = $newType;
|
||||
|
||||
if ($oldType === self::PUBLIC_CALL) {
|
||||
if ($oldType === self::TYPE_PUBLIC) {
|
||||
// Kick all guests and users that were not invited
|
||||
$query = $this->db->getQueryBuilder();
|
||||
$query->delete('talk_attendees')
|
||||
|
|
@ -903,7 +903,7 @@ class Room {
|
|||
* @param int $newState Currently it is only allowed to change between
|
||||
* `self::READ_ONLY` and `self::READ_WRITE`
|
||||
* Also it's only allowed on rooms of type
|
||||
* `self::GROUP_CALL` and `self::PUBLIC_CALL`
|
||||
* `self::TYPE_GROUP` and `self::TYPE_PUBLIC`
|
||||
* @return bool True when the change was valid, false otherwise
|
||||
*/
|
||||
public function setReadOnly(int $newState): bool {
|
||||
|
|
@ -912,7 +912,7 @@ class Room {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!in_array($this->getType(), [self::GROUP_CALL, self::PUBLIC_CALL, self::CHANGELOG_CONVERSATION], true)) {
|
||||
if (!in_array($this->getType(), [self::TYPE_GROUP, self::TYPE_PUBLIC, self::TYPE_CHANGELOG], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -939,7 +939,7 @@ class Room {
|
|||
/**
|
||||
* @param int $newState New listable scope from self::LISTABLE_*
|
||||
* Also it's only allowed on rooms of type
|
||||
* `self::GROUP_CALL` and `self::PUBLIC_CALL`
|
||||
* `self::TYPE_GROUP` and `self::TYPE_PUBLIC`
|
||||
* @return bool True when the change was valid, false otherwise
|
||||
*/
|
||||
public function setListable(int $newState): bool {
|
||||
|
|
@ -948,7 +948,7 @@ class Room {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (!in_array($this->getType(), [self::GROUP_CALL, self::PUBLIC_CALL], true)) {
|
||||
if (!in_array($this->getType(), [self::TYPE_GROUP, self::TYPE_PUBLIC], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -988,7 +988,7 @@ class Room {
|
|||
public function setLobby(int $newState, ?\DateTime $dateTime, bool $timerReached = false): bool {
|
||||
$oldState = $this->lobbyState;
|
||||
|
||||
if (!in_array($this->getType(), [self::GROUP_CALL, self::PUBLIC_CALL], true)) {
|
||||
if (!in_array($this->getType(), [self::TYPE_GROUP, self::TYPE_PUBLIC], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1024,7 +1024,7 @@ class Room {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!in_array($this->getType(), [self::GROUP_CALL, self::PUBLIC_CALL], true)) {
|
||||
if (!in_array($this->getType(), [self::TYPE_GROUP, self::TYPE_PUBLIC], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class ConversationSearch implements IProvider {
|
|||
|
||||
$result = [];
|
||||
foreach ($rooms as $room) {
|
||||
if ($room->getType() === Room::CHANGELOG_CONVERSATION) {
|
||||
if ($room->getType() === Room::TYPE_CHANGELOG) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ class ConversationSearch implements IProvider {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$otherUserId = str_replace(
|
||||
json_encode($user->getUID()),
|
||||
'',
|
||||
|
|
@ -119,7 +119,7 @@ class ConversationSearch implements IProvider {
|
|||
|
||||
$icon = '';
|
||||
$iconClass = '';
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$users = json_decode($room->getName(), true);
|
||||
foreach ($users as $participantId) {
|
||||
if ($participantId !== $user->getUID()) {
|
||||
|
|
@ -135,7 +135,7 @@ class ConversationSearch implements IProvider {
|
|||
$iconClass = 'conversation-icon icon-password';
|
||||
} elseif ($room->getObjectType() === 'emails') {
|
||||
$iconClass = 'conversation-icon icon-mail';
|
||||
} elseif ($room->getType() === Room::PUBLIC_CALL) {
|
||||
} elseif ($room->getType() === Room::TYPE_PUBLIC) {
|
||||
$iconClass = 'conversation-icon icon-public';
|
||||
} else {
|
||||
$iconClass = 'conversation-icon icon-contacts';
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class MessageSearch implements IProvider {
|
|||
|
||||
$roomMap = [];
|
||||
foreach ($rooms as $room) {
|
||||
if ($room->getType() === Room::CHANGELOG_CONVERSATION) {
|
||||
if ($room->getType() === Room::TYPE_CHANGELOG) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +202,7 @@ class MessageSearch implements IProvider {
|
|||
}
|
||||
|
||||
$subline = $this->getSublineTemplate();
|
||||
if ($room->getType() === Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() === Room::TYPE_ONE_TO_ONE) {
|
||||
$subline = '{user}';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ class ParticipantService {
|
|||
$manager = \OC::$server->get(\OCA\Talk\Manager::class);
|
||||
|
||||
// User joining a group or public call through listing
|
||||
if (($room->getType() === Room::GROUP_CALL || $room->getType() === Room::PUBLIC_CALL) &&
|
||||
if (($room->getType() === Room::TYPE_GROUP || $room->getType() === Room::TYPE_PUBLIC) &&
|
||||
$manager->isRoomListableByUser($room, $user->getUID())
|
||||
) {
|
||||
$this->addUsers($room, [[
|
||||
|
|
@ -259,7 +259,7 @@ class ParticipantService {
|
|||
// need to use "USER" here, because "USER_SELF_JOINED" only works for public calls
|
||||
'participantType' => Participant::USER,
|
||||
]], $user);
|
||||
} elseif ($room->getType() === Room::PUBLIC_CALL) {
|
||||
} elseif ($room->getType() === Room::TYPE_PUBLIC) {
|
||||
// User joining a public room, without being invited
|
||||
$this->addUsers($room, [[
|
||||
'actorType' => Attendee::ACTOR_USERS,
|
||||
|
|
@ -638,7 +638,7 @@ class ParticipantService {
|
|||
}
|
||||
|
||||
public function ensureOneToOneRoomIsFilled(Room $room): void {
|
||||
if ($room->getType() !== Room::ONE_TO_ONE_CALL) {
|
||||
if ($room->getType() !== Room::TYPE_ONE_TO_ONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ class RoomService {
|
|||
} catch (RoomNotFoundException $e) {
|
||||
$users = [$actor->getUID(), $targetUser->getUID()];
|
||||
sort($users);
|
||||
$room = $this->manager->createRoom(Room::ONE_TO_ONE_CALL, json_encode($users));
|
||||
$room = $this->manager->createRoom(Room::TYPE_ONE_TO_ONE, json_encode($users));
|
||||
|
||||
$this->participantService->addUsers($room, [
|
||||
[
|
||||
|
|
@ -107,9 +107,9 @@ class RoomService {
|
|||
}
|
||||
|
||||
if (!\in_array($type, [
|
||||
Room::GROUP_CALL,
|
||||
Room::PUBLIC_CALL,
|
||||
Room::CHANGELOG_CONVERSATION,
|
||||
Room::TYPE_GROUP,
|
||||
Room::TYPE_PUBLIC,
|
||||
Room::TYPE_CHANGELOG,
|
||||
], true)) {
|
||||
throw new InvalidArgumentException('type');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class ShareAPIController {
|
|||
// so the avatars for conversations are distinguishable
|
||||
$result['share_with'] = 'private_conversation_' . substr(sha1($room->getName() . $room->getId()), 0, 6);
|
||||
}
|
||||
if ($room->getType() === Room::PUBLIC_CALL) {
|
||||
if ($room->getType() === Room::TYPE_PUBLIC) {
|
||||
$result['token'] = $share->getToken();
|
||||
}
|
||||
$result['share_with_link'] = $this->urlGenerator->linkToRouteAbsolute('spreed.Page.showCall', ['token' => $room->getToken()]);
|
||||
|
|
|
|||
|
|
@ -894,7 +894,7 @@ class RoomShareProvider implements IShareProvider {
|
|||
throw new ShareNotFound();
|
||||
}
|
||||
|
||||
if ($room->getType() !== Room::PUBLIC_CALL) {
|
||||
if ($room->getType() !== Room::TYPE_PUBLIC) {
|
||||
throw new ShareNotFound();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -204,12 +204,12 @@ class BaseTest extends TestCase {
|
|||
|
||||
public function dataGetRoom() {
|
||||
return [
|
||||
[Room::ONE_TO_ONE_CALL, 23, 'private-call', 'private-call', 'one2one'],
|
||||
[Room::GROUP_CALL, 42, 'group-call', 'group-call', 'group'],
|
||||
[Room::PUBLIC_CALL, 128, 'public-call', 'public-call', 'public'],
|
||||
[Room::ONE_TO_ONE_CALL, 23, '', 'a conversation', 'one2one'],
|
||||
[Room::GROUP_CALL, 42, '', 'a conversation', 'group'],
|
||||
[Room::PUBLIC_CALL, 128, '', 'a conversation', 'public'],
|
||||
[Room::TYPE_ONE_TO_ONE, 23, 'private-call', 'private-call', 'one2one'],
|
||||
[Room::TYPE_GROUP, 42, 'group-call', 'group-call', 'group'],
|
||||
[Room::TYPE_PUBLIC, 128, 'public-call', 'public-call', 'public'],
|
||||
[Room::TYPE_ONE_TO_ONE, 23, '', 'a conversation', 'one2one'],
|
||||
[Room::TYPE_GROUP, 42, '', 'a conversation', 'group'],
|
||||
[Room::TYPE_PUBLIC, 128, '', 'a conversation', 'public'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ class UserMentionTest extends \Test\TestCase {
|
|||
$room = $this->createMock(Room::class);
|
||||
$room->expects($this->once())
|
||||
->method('getType')
|
||||
->willReturn(Room::GROUP_CALL);
|
||||
->willReturn(Room::TYPE_GROUP);
|
||||
$room->expects($this->once())
|
||||
->method('getToken')
|
||||
->willReturn('token');
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class ListenerTest extends TestCase {
|
|||
$room = $this->createMock(Room::class);
|
||||
$room->expects($this->any())
|
||||
->method('getType')
|
||||
->willReturn(Room::ONE_TO_ONE_CALL);
|
||||
->willReturn(Room::TYPE_ONE_TO_ONE);
|
||||
|
||||
$participants = [[
|
||||
'actorType' => 'users',
|
||||
|
|
@ -194,11 +194,11 @@ class ListenerTest extends TestCase {
|
|||
];
|
||||
|
||||
return [
|
||||
[Room::GROUP_CALL, '', $allParticipants, $expectedMessages],
|
||||
[Room::PUBLIC_CALL, '', $allParticipants, $expectedMessages],
|
||||
[Room::ONE_TO_ONE_CALL, '', $allParticipants, []],
|
||||
[Room::GROUP_CALL, 'file', $allParticipants, $expectedMessages],
|
||||
[Room::PUBLIC_CALL, 'file', $allParticipants, $expectedMessages],
|
||||
[Room::TYPE_GROUP, '', $allParticipants, $expectedMessages],
|
||||
[Room::TYPE_PUBLIC, '', $allParticipants, $expectedMessages],
|
||||
[Room::TYPE_ONE_TO_ONE, '', $allParticipants, []],
|
||||
[Room::TYPE_GROUP, 'file', $allParticipants, $expectedMessages],
|
||||
[Room::TYPE_PUBLIC, 'file', $allParticipants, $expectedMessages],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ class ListenerTest extends TestCase {
|
|||
$this->mockLoggedInUser('alice_actor');
|
||||
|
||||
$room = $this->createMock(Room::class);
|
||||
$room->method('getType')->willReturn(Room::GROUP_CALL);
|
||||
$room->method('getType')->willReturn(Room::TYPE_GROUP);
|
||||
|
||||
$attendee = new Attendee();
|
||||
$attendee->setActorId('bob_participant');
|
||||
|
|
|
|||
|
|
@ -105,34 +105,34 @@ class RoomPluginTest extends \Test\TestCase {
|
|||
|
||||
// Empty search term with rooms
|
||||
['', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Room name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Room name')
|
||||
], [], [], false],
|
||||
|
||||
// Search term with no matches
|
||||
['Unmatched search term', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Unmatched name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Unmatched name')
|
||||
], [], [], false],
|
||||
|
||||
// Search term with single wide match
|
||||
['room', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken2', 'Unmatched name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken2', 'Unmatched name')
|
||||
], [], [
|
||||
$this->newResult('Room name', 'roomToken')
|
||||
], false],
|
||||
|
||||
// Search term with single exact match
|
||||
['room name', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Unmatched name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken2', 'Room name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Unmatched name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken2', 'Room name')
|
||||
], [
|
||||
$this->newResult('Room name', 'roomToken2')
|
||||
], [], false],
|
||||
|
||||
// Search term with single exact match and single wide match
|
||||
['room name', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Room name that also matches'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken2', 'Room name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Room name that also matches'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken2', 'Room name')
|
||||
], [
|
||||
$this->newResult('Room name', 'roomToken2')
|
||||
], [
|
||||
|
|
@ -143,8 +143,8 @@ class RoomPluginTest extends \Test\TestCase {
|
|||
// as one-to-one rooms do not have a name, but it would be if they
|
||||
// had, so it is included here for completeness).
|
||||
['room name', 2, 0, [
|
||||
$this->newRoom(Room::ONE_TO_ONE_CALL, 'roomToken', 'Room name that also matches'),
|
||||
$this->newRoom(Room::ONE_TO_ONE_CALL, 'roomToken2', 'Room name')
|
||||
$this->newRoom(Room::TYPE_ONE_TO_ONE, 'roomToken', 'Room name that also matches'),
|
||||
$this->newRoom(Room::TYPE_ONE_TO_ONE, 'roomToken2', 'Room name')
|
||||
], [
|
||||
$this->newResult('Room name', 'roomToken2')
|
||||
], [
|
||||
|
|
@ -153,8 +153,8 @@ class RoomPluginTest extends \Test\TestCase {
|
|||
|
||||
// Search term matching public rooms
|
||||
['room name', 2, 0, [
|
||||
$this->newRoom(Room::PUBLIC_CALL, 'roomToken', 'Room name that also matches'),
|
||||
$this->newRoom(Room::PUBLIC_CALL, 'roomToken2', 'Room name')
|
||||
$this->newRoom(Room::TYPE_PUBLIC, 'roomToken', 'Room name that also matches'),
|
||||
$this->newRoom(Room::TYPE_PUBLIC, 'roomToken2', 'Room name')
|
||||
], [
|
||||
$this->newResult('Room name', 'roomToken2')
|
||||
], [
|
||||
|
|
@ -163,10 +163,10 @@ class RoomPluginTest extends \Test\TestCase {
|
|||
|
||||
// Search term with several wide matches
|
||||
['room', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken2', 'Another room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken3', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken4', 'Another room name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken2', 'Another room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken3', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken4', 'Another room name')
|
||||
], [], [
|
||||
$this->newResult('Room name', 'roomToken'),
|
||||
$this->newResult('Another room name', 'roomToken2'),
|
||||
|
|
@ -176,10 +176,10 @@ class RoomPluginTest extends \Test\TestCase {
|
|||
|
||||
// Search term with several exact matches
|
||||
['room name', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken2', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken3', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken4', 'Room name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken2', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken3', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken4', 'Room name')
|
||||
], [
|
||||
$this->newResult('Room name', 'roomToken'),
|
||||
$this->newResult('Room name', 'roomToken2'),
|
||||
|
|
@ -189,17 +189,17 @@ class RoomPluginTest extends \Test\TestCase {
|
|||
|
||||
// Search term with several matches
|
||||
['room name', 2, 0, [
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken2', 'Unmatched name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken3', 'Another room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken4', 'Room name'),
|
||||
$this->newRoom(Room::ONE_TO_ONE_CALL, 'roomToken5', 'Room name'),
|
||||
$this->newRoom(Room::PUBLIC_CALL, 'roomToken6', 'Room name'),
|
||||
$this->newRoom(Room::GROUP_CALL, 'roomToken7', 'Another unmatched name'),
|
||||
$this->newRoom(Room::ONE_TO_ONE_CALL, 'roomToken8', 'Another unmatched name'),
|
||||
$this->newRoom(Room::PUBLIC_CALL, 'roomToken9', 'Another unmatched name'),
|
||||
$this->newRoom(Room::ONE_TO_ONE_CALL, 'roomToken10', 'Another room name'),
|
||||
$this->newRoom(Room::PUBLIC_CALL, 'roomToken11', 'Another room name')
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken2', 'Unmatched name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken3', 'Another room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken4', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_ONE_TO_ONE, 'roomToken5', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_PUBLIC, 'roomToken6', 'Room name'),
|
||||
$this->newRoom(Room::TYPE_GROUP, 'roomToken7', 'Another unmatched name'),
|
||||
$this->newRoom(Room::TYPE_ONE_TO_ONE, 'roomToken8', 'Another unmatched name'),
|
||||
$this->newRoom(Room::TYPE_PUBLIC, 'roomToken9', 'Another unmatched name'),
|
||||
$this->newRoom(Room::TYPE_ONE_TO_ONE, 'roomToken10', 'Another room name'),
|
||||
$this->newRoom(Room::TYPE_PUBLIC, 'roomToken11', 'Another room name')
|
||||
], [
|
||||
$this->newResult('Room name', 'roomToken'),
|
||||
$this->newResult('Room name', 'roomToken4'),
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->with($this->userId)
|
||||
->willReturn([
|
||||
'name' => $roomName,
|
||||
'type' => Room::ONE_TO_ONE_CALL,
|
||||
'type' => Room::TYPE_ONE_TO_ONE,
|
||||
]);
|
||||
|
||||
$result = $this->performBackendRequest([
|
||||
|
|
@ -430,7 +430,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
'roomid' => $roomToken,
|
||||
'properties' => [
|
||||
'name' => $roomName,
|
||||
'type' => Room::ONE_TO_ONE_CALL,
|
||||
'type' => Room::TYPE_ONE_TO_ONE,
|
||||
],
|
||||
'permissions' => [
|
||||
'publish-audio',
|
||||
|
|
@ -472,7 +472,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->with($this->userId)
|
||||
->willReturn([
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
]);
|
||||
|
||||
$result = $this->performBackendRequest([
|
||||
|
|
@ -490,7 +490,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
'roomid' => $roomToken,
|
||||
'properties' => [
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
],
|
||||
'permissions' => [
|
||||
'publish-audio',
|
||||
|
|
@ -536,7 +536,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->with($this->userId)
|
||||
->willReturn([
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
]);
|
||||
|
||||
$result = $this->performBackendRequest([
|
||||
|
|
@ -554,7 +554,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
'roomid' => $roomToken,
|
||||
'properties' => [
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
],
|
||||
'permissions' => [
|
||||
'publish-audio',
|
||||
|
|
@ -598,7 +598,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->with('')
|
||||
->willReturn([
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
]);
|
||||
|
||||
$result = $this->performBackendRequest([
|
||||
|
|
@ -616,7 +616,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
'roomid' => $roomToken,
|
||||
'properties' => [
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
],
|
||||
'permissions' => [
|
||||
'publish-audio',
|
||||
|
|
@ -659,7 +659,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->with($this->userId)
|
||||
->willReturn([
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
]);
|
||||
|
||||
$result = $this->performBackendRequest([
|
||||
|
|
@ -677,7 +677,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
'roomid' => $roomToken,
|
||||
'properties' => [
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
],
|
||||
'permissions' => [
|
||||
'publish-audio',
|
||||
|
|
@ -738,7 +738,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->with($this->userId)
|
||||
->willReturn([
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
]);
|
||||
|
||||
$result = $this->performBackendRequest([
|
||||
|
|
@ -756,7 +756,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
'roomid' => $roomToken,
|
||||
'properties' => [
|
||||
'name' => $roomName,
|
||||
'type' => Room::PUBLIC_CALL,
|
||||
'type' => Room::TYPE_PUBLIC,
|
||||
],
|
||||
'permissions' => $expectedBackendPermissions,
|
||||
],
|
||||
|
|
@ -832,7 +832,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->with($this->userId)
|
||||
->willReturn([
|
||||
'name' => $roomName,
|
||||
'type' => Room::ONE_TO_ONE_CALL,
|
||||
'type' => Room::TYPE_ONE_TO_ONE,
|
||||
]);
|
||||
|
||||
$result = $this->performBackendRequest([
|
||||
|
|
@ -850,7 +850,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
'roomid' => $roomToken,
|
||||
'properties' => [
|
||||
'name' => $roomName,
|
||||
'type' => Room::ONE_TO_ONE_CALL,
|
||||
'type' => Room::TYPE_ONE_TO_ONE,
|
||||
],
|
||||
'permissions' => [
|
||||
'publish-audio',
|
||||
|
|
@ -1055,7 +1055,7 @@ class SignalingControllerTest extends \Test\TestCase {
|
|||
->method('getUID')
|
||||
->willReturn($this->userId);
|
||||
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
|
||||
// The user joined the room.
|
||||
$oldParticipant = $participantService->joinRoom($room, $testUser, '');
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$room = $this->createMock(Room::class);
|
||||
$room->expects($this->any())
|
||||
->method('getType')
|
||||
->willReturn(Room::ONE_TO_ONE_CALL);
|
||||
->willReturn(Room::TYPE_ONE_TO_ONE);
|
||||
$room->expects($this->any())
|
||||
->method('getId')
|
||||
->willReturn(1234);
|
||||
|
|
@ -241,7 +241,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$room = $this->createMock(Room::class);
|
||||
$room->expects($this->any())
|
||||
->method('getType')
|
||||
->willReturn(Room::ONE_TO_ONE_CALL);
|
||||
->willReturn(Room::TYPE_ONE_TO_ONE);
|
||||
$room->expects($this->any())
|
||||
->method('getId')
|
||||
->willReturn(1234);
|
||||
|
|
@ -342,8 +342,8 @@ class NotifierTest extends \Test\TestCase {
|
|||
|
||||
public function dataPrepareGroup() {
|
||||
return [
|
||||
[Room::GROUP_CALL, 'admin', 'Admin', 'Group', 'Admin invited you to a group conversation: Group'],
|
||||
[Room::PUBLIC_CALL, 'test', 'Test user', 'Public', 'Test user invited you to a group conversation: Public'],
|
||||
[Room::TYPE_GROUP, 'admin', 'Admin', 'Group', 'Admin invited you to a group conversation: Group'],
|
||||
[Room::TYPE_PUBLIC, 'test', 'Test user', 'Public', 'Test user invited you to a group conversation: Public'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -415,7 +415,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
->method('getId')
|
||||
->willReturn($roomId);
|
||||
|
||||
if ($type === Room::GROUP_CALL) {
|
||||
if ($type === Room::TYPE_GROUP) {
|
||||
$n->expects($this->once())
|
||||
->method('setRichSubject')
|
||||
->with('{user} invited you to a group conversation: {call}',[
|
||||
|
|
@ -476,7 +476,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
public function dataPrepareChatMessage(): array {
|
||||
return [
|
||||
'one-to-one mention' => [
|
||||
$subject = 'mention', Room::ONE_TO_ONE_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
$subject = 'mention', Room::TYPE_ONE_TO_ONE, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
'Test user mentioned you in a private conversation',
|
||||
[
|
||||
'{user} mentioned you in a private conversation',
|
||||
|
|
@ -487,7 +487,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'user mention' => [
|
||||
$subject = 'mention', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'mention', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user mentioned you in conversation Room name',
|
||||
[
|
||||
'{user} mentioned you in conversation {call}',
|
||||
|
|
@ -498,7 +498,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'deleted user mention' => [
|
||||
$subject = 'mention', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'mention', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'A deleted user mentioned you in conversation Room name',
|
||||
[
|
||||
'A deleted user mentioned you in conversation {call}',
|
||||
|
|
@ -509,7 +509,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true,
|
||||
],
|
||||
'user mention public' => [
|
||||
$subject = 'mention', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'mention', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user mentioned you in conversation Room name',
|
||||
[
|
||||
'{user} mentioned you in conversation {call}',
|
||||
|
|
@ -520,7 +520,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'deleted user mention public' => [
|
||||
$subject = 'mention', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'mention', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'A deleted user mentioned you in conversation Room name',
|
||||
[
|
||||
'A deleted user mentioned you in conversation {call}',
|
||||
|
|
@ -531,7 +531,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true,
|
||||
],
|
||||
'guest mention' => [
|
||||
$subject = 'mention', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'mention', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'A guest mentioned you in conversation Room name',
|
||||
[
|
||||
'A guest mentioned you in conversation {call}',
|
||||
|
|
@ -542,7 +542,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = null,
|
||||
],
|
||||
'named guest mention' => [
|
||||
$subject = 'mention', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'mention', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'MyNameIs (guest) mentioned you in conversation Room name',
|
||||
[
|
||||
'{guest} (guest) mentioned you in conversation {call}',
|
||||
|
|
@ -554,7 +554,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = 'MyNameIs',
|
||||
],
|
||||
'empty named guest mention' => [
|
||||
$subject = 'mention', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'mention', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'A guest mentioned you in conversation Room name',
|
||||
[
|
||||
'A guest mentioned you in conversation {call}',
|
||||
|
|
@ -567,7 +567,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
|
||||
// Normal messages
|
||||
'one-to-one message' => [
|
||||
$subject = 'chat', Room::ONE_TO_ONE_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
$subject = 'chat', Room::TYPE_ONE_TO_ONE, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
'Test user sent you a private message',
|
||||
[
|
||||
'{user} sent you a private message',
|
||||
|
|
@ -578,7 +578,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'user message' => [
|
||||
$subject = 'chat', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'chat', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user sent a message in conversation Room name',
|
||||
[
|
||||
'{user} sent a message in conversation {call}',
|
||||
|
|
@ -589,7 +589,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'deleted user message' => [
|
||||
$subject = 'chat', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'A deleted user sent a message in conversation Room name',
|
||||
[
|
||||
'A deleted user sent a message in conversation {call}',
|
||||
|
|
@ -600,7 +600,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true,
|
||||
],
|
||||
'user message public' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user sent a message in conversation Room name',
|
||||
[
|
||||
'{user} sent a message in conversation {call}',
|
||||
|
|
@ -611,7 +611,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'deleted user message public' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'A deleted user sent a message in conversation Room name',
|
||||
[
|
||||
'A deleted user sent a message in conversation {call}',
|
||||
|
|
@ -622,7 +622,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true
|
||||
],
|
||||
'guest message' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'A guest sent a message in conversation Room name',
|
||||
['A guest sent a message in conversation {call}',
|
||||
[
|
||||
|
|
@ -632,7 +632,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = null,
|
||||
],
|
||||
'named guest message' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'MyNameIs (guest) sent a message in conversation Room name',
|
||||
[
|
||||
'{guest} (guest) sent a message in conversation {call}',
|
||||
|
|
@ -644,7 +644,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = 'MyNameIs',
|
||||
],
|
||||
'empty named guest message' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'A guest sent a message in conversation Room name',
|
||||
[
|
||||
'A guest sent a message in conversation {call}',
|
||||
|
|
@ -657,7 +657,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
|
||||
// Reply
|
||||
'one-to-one reply' => [
|
||||
$subject = 'reply', Room::ONE_TO_ONE_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
$subject = 'reply', Room::TYPE_ONE_TO_ONE, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
'Test user replied to your private message',
|
||||
[
|
||||
'{user} replied to your private message',
|
||||
|
|
@ -668,7 +668,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'user reply' => [
|
||||
$subject = 'reply', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'reply', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user replied to your message in conversation Room name',
|
||||
[
|
||||
'{user} replied to your message in conversation {call}',
|
||||
|
|
@ -679,7 +679,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'deleted user reply' => [
|
||||
$subject = 'reply', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'reply', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'A deleted user replied to your message in conversation Room name',
|
||||
[
|
||||
'A deleted user replied to your message in conversation {call}',
|
||||
|
|
@ -690,7 +690,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true,
|
||||
],
|
||||
'user message reply' => [
|
||||
$subject = 'reply', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'reply', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user replied to your message in conversation Room name',
|
||||
[
|
||||
'{user} replied to your message in conversation {call}',
|
||||
|
|
@ -701,7 +701,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
],
|
||||
],
|
||||
'deleted user message reply' => [
|
||||
$subject = 'reply', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'reply', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'A deleted user replied to your message in conversation Room name',
|
||||
[
|
||||
'A deleted user replied to your message in conversation {call}',
|
||||
|
|
@ -712,7 +712,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true
|
||||
],
|
||||
'guest reply' => [
|
||||
$subject = 'reply', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'reply', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'A guest replied to your message in conversation Room name',
|
||||
['A guest replied to your message in conversation {call}',
|
||||
[
|
||||
|
|
@ -722,7 +722,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = null,
|
||||
],
|
||||
'named guest reply' => [
|
||||
$subject = 'reply', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'reply', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'MyNameIs (guest) replied to your message in conversation Room name',
|
||||
[
|
||||
'{guest} (guest) replied to your message in conversation {call}',
|
||||
|
|
@ -734,7 +734,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = 'MyNameIs',
|
||||
],
|
||||
'empty named guest reply' => [
|
||||
$subject = 'reply', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'reply', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'A guest replied to your message in conversation Room name',
|
||||
[
|
||||
'A guest replied to your message in conversation {call}',
|
||||
|
|
@ -747,7 +747,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
|
||||
// Push messages
|
||||
'one-to-one push' => [
|
||||
$subject = 'chat', Room::ONE_TO_ONE_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
$subject = 'chat', Room::TYPE_ONE_TO_ONE, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Test user',
|
||||
'Test user' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'{user}' . "\n" . '{message}',
|
||||
|
|
@ -760,7 +760,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = null, $isPushNotification = true,
|
||||
],
|
||||
'user push' => [
|
||||
$subject = 'chat', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'chat', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user in Room name' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'{user} in {call}' . "\n" . '{message}',
|
||||
|
|
@ -773,7 +773,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = null, $isPushNotification = true,
|
||||
],
|
||||
'deleted user push' => [
|
||||
$subject = 'chat', Room::GROUP_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_GROUP, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'Deleted user in Room name' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'Deleted user in {call}' . "\n" . '{message}',
|
||||
|
|
@ -785,7 +785,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true, $guestName = null, $isPushNotification = true,
|
||||
],
|
||||
'user push public' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], 'Test user', 'Room name',
|
||||
'Test user in Room name' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'{user} in {call}' . "\n" . '{message}',
|
||||
|
|
@ -798,7 +798,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = null, $isPushNotification = true,
|
||||
],
|
||||
'deleted user push public' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'users', 'userId' => 'testUser'], null, 'Room name',
|
||||
'Deleted user in Room name' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'Deleted user in {call}' . "\n" . '{message}',
|
||||
|
|
@ -810,7 +810,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = true, $guestName = null, $isPushNotification = true,
|
||||
],
|
||||
'guest push public' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'Guest in Room name' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'Guest in {call}' . "\n" . '{message}',
|
||||
|
|
@ -822,7 +822,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = null, $isPushNotification = true,
|
||||
],
|
||||
'named guest push public' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'MyNameIs (guest) in Room name' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'{guest} (guest) in {call}' . "\n" . '{message}',
|
||||
|
|
@ -835,7 +835,7 @@ class NotifierTest extends \Test\TestCase {
|
|||
$deletedUser = false, $guestName = 'MyNameIs', $isPushNotification = true,
|
||||
],
|
||||
'empty named guest push public' => [
|
||||
$subject = 'chat', Room::PUBLIC_CALL, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
$subject = 'chat', Room::TYPE_PUBLIC, ['userType' => 'guests', 'userId' => 'testSpreedSession'], null, 'Room name',
|
||||
'Guest in Room name' . "\n" . 'Hi @Administrator',
|
||||
[
|
||||
'Guest in {call}' . "\n" . '{message}',
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class RoomTest extends TestCase {
|
|||
$this->createMock(ITimeFactory::class),
|
||||
$this->createMock(IHasher::class),
|
||||
1,
|
||||
Room::PUBLIC_CALL,
|
||||
Room::TYPE_PUBLIC,
|
||||
Room::READ_WRITE,
|
||||
Room::LISTABLE_NONE,
|
||||
Webinary::LOBBY_NONE,
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class RoomServiceTest extends TestCase {
|
|||
|
||||
$this->manager->expects($this->once())
|
||||
->method('createRoom')
|
||||
->with(Room::ONE_TO_ONE_CALL)
|
||||
->with(Room::TYPE_ONE_TO_ONE)
|
||||
->willReturn($room);
|
||||
|
||||
$this->assertSame($room, $this->service->createOneToOneConversation($user1, $user2));
|
||||
|
|
@ -153,13 +153,13 @@ class RoomServiceTest extends TestCase {
|
|||
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('name');
|
||||
$this->service->createConversation(Room::GROUP_CALL, $name);
|
||||
$this->service->createConversation(Room::TYPE_GROUP, $name);
|
||||
}
|
||||
|
||||
public function dataCreateConversationInvalidTypes(): array {
|
||||
return [
|
||||
[Room::ONE_TO_ONE_CALL],
|
||||
[Room::UNKNOWN_CALL],
|
||||
[Room::TYPE_ONE_TO_ONE],
|
||||
[Room::TYPE_UNKNOWN],
|
||||
[5],
|
||||
];
|
||||
}
|
||||
|
|
@ -198,14 +198,14 @@ class RoomServiceTest extends TestCase {
|
|||
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage($exception);
|
||||
$this->service->createConversation(Room::PUBLIC_CALL, 'a', null, $type, $id);
|
||||
$this->service->createConversation(Room::TYPE_PUBLIC, 'a', null, $type, $id);
|
||||
}
|
||||
|
||||
public function dataCreateConversation(): array {
|
||||
return [
|
||||
[Room::GROUP_CALL, 'Group conversation', 'admin', '', ''],
|
||||
[Room::PUBLIC_CALL, 'Public conversation', '', 'files', '123456'],
|
||||
[Room::CHANGELOG_CONVERSATION, 'Talk updates ✅', 'test1', 'changelog', 'conversation'],
|
||||
[Room::TYPE_GROUP, 'Group conversation', 'admin', '', ''],
|
||||
[Room::TYPE_PUBLIC, 'Public conversation', '', 'files', '123456'],
|
||||
[Room::TYPE_CHANGELOG, 'Talk updates ✅', 'test1', 'changelog', 'conversation'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomInvite() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$this->participantService->addUsers($room, [[
|
||||
'actorType' => 'users',
|
||||
'actorId' => $this->userId,
|
||||
|
|
@ -265,7 +265,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomDisinvite() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$this->participantService->addUsers($room, [[
|
||||
'actorType' => 'users',
|
||||
'actorId' => $this->userId,
|
||||
|
|
@ -301,7 +301,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomNameChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$room->setName('Test room');
|
||||
|
||||
$this->assertMessageWasSent($room, [
|
||||
|
|
@ -325,7 +325,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomDescriptionChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$room->setDescription('The description');
|
||||
|
||||
$this->assertMessageWasSent($room, [
|
||||
|
|
@ -349,7 +349,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomPasswordChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$room->setPassword('password');
|
||||
|
||||
$this->assertMessageWasSent($room, [
|
||||
|
|
@ -373,8 +373,8 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomTypeChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room->setType(Room::GROUP_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$room->setType(Room::TYPE_GROUP);
|
||||
|
||||
$this->assertMessageWasSent($room, [
|
||||
'type' => 'update',
|
||||
|
|
@ -397,7 +397,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomReadOnlyChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$room->setReadOnly(Room::READ_ONLY);
|
||||
|
||||
$this->assertMessageWasSent($room, [
|
||||
|
|
@ -421,7 +421,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomListableChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$room->setListable(Room::LISTABLE_ALL);
|
||||
|
||||
$this->assertMessageWasSent($room, [
|
||||
|
|
@ -445,7 +445,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomLobbyStateChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$room->setLobby(Webinary::LOBBY_NON_MODERATORS, null);
|
||||
|
||||
$this->assertMessageWasSent($room, [
|
||||
|
|
@ -469,7 +469,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomDelete() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$this->participantService->addUsers($room, [[
|
||||
'actorType' => 'users',
|
||||
'actorId' => $this->userId,
|
||||
|
|
@ -487,7 +487,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testRoomInCallChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$this->participantService->addUsers($room, [[
|
||||
'actorType' => 'users',
|
||||
'actorId' => $this->userId,
|
||||
|
|
@ -611,7 +611,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
|
||||
$this->dispatcher->addListener(Room::EVENT_BEFORE_SIGNALING_PROPERTIES, $listener);
|
||||
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$this->controller->clearRequests();
|
||||
$room->setName('Test room');
|
||||
|
||||
|
|
@ -638,7 +638,7 @@ class BackendNotifierTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testParticipantsTypeChanged() {
|
||||
$room = $this->manager->createRoom(Room::PUBLIC_CALL);
|
||||
$room = $this->manager->createRoom(Room::TYPE_PUBLIC);
|
||||
$this->participantService->addUsers($room, [[
|
||||
'actorType' => 'users',
|
||||
'actorId' => $this->userId,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue