Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2019-08-28 11:06:21 +0300
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2019-08-28 11:28:30 +0300
commit8745fd19fe6c36a9b6d5b7f45abe3c53ed7a2798 (patch)
treeac311bb103fd4afd40865baeb85cc57e6fcb7d3d /lib
parent0e4fcbbf6b4eec0fe7d11c27f475d91f743bb2c2 (diff)
Rename lobby constants
The lobby constants were named from the point of view of the webinary (open to all participants, open to moderators only), but from the point of view of the lobby it is the opposite (no lobby, lobby for non moderators). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Chat/Parser/SystemMessage.php4
-rw-r--r--lib/Chat/SystemMessage/Listener.php8
-rw-r--r--lib/Controller/RoomController.php2
-rw-r--r--lib/Middleware/InjectionMiddleware.php2
-rw-r--r--lib/Room.php6
-rw-r--r--lib/Webinary.php4
6 files changed, 13 insertions, 13 deletions
diff --git a/lib/Chat/Parser/SystemMessage.php b/lib/Chat/Parser/SystemMessage.php
index d56d37663..21536b107 100644
--- a/lib/Chat/Parser/SystemMessage.php
+++ b/lib/Chat/Parser/SystemMessage.php
@@ -140,12 +140,12 @@ class SystemMessage {
}
} else if ($message === 'lobby_timer_reached') {
$parsedMessage = $this->l->t('The conversation is now open to everyone');
- } else if ($message === 'lobby_all_participants') {
+ } else if ($message === 'lobby_none') {
$parsedMessage = $this->l->t('{actor} opened the conversation to everyone');
if ($currentUserIsActor) {
$parsedMessage = $this->l->t('You opened the conversation to everyone');
}
- } else if ($message === 'lobby_moderators_only') {
+ } else if ($message === 'lobby_non_moderators') {
$parsedMessage = $this->l->t('{actor} restricted the conversation to moderators');
if ($currentUserIsActor) {
$parsedMessage = $this->l->t('You restricted the conversation to moderators');
diff --git a/lib/Chat/SystemMessage/Listener.php b/lib/Chat/SystemMessage/Listener.php
index abfab3ba1..c18cb016f 100644
--- a/lib/Chat/SystemMessage/Listener.php
+++ b/lib/Chat/SystemMessage/Listener.php
@@ -173,10 +173,10 @@ class Listener {
if ($arguments['timerReached']) {
$listener->sendSystemMessage($room, 'lobby_timer_reached', $event->getArguments());
- } else if ($arguments['newState'] === Webinary::ALL_PARTICIPANTS) {
- $listener->sendSystemMessage($room, 'lobby_all_participants', $event->getArguments());
- } else if ($arguments['newState'] === Webinary::MODERATORS_ONLY) {
- $listener->sendSystemMessage($room, 'lobby_moderators_only', $event->getArguments());
+ } else if ($arguments['newState'] === Webinary::LOBBY_NONE) {
+ $listener->sendSystemMessage($room, 'lobby_none', $event->getArguments());
+ } else if ($arguments['newState'] === Webinary::LOBBY_NON_MODERATORS) {
+ $listener->sendSystemMessage($room, 'lobby_non_moderators', $event->getArguments());
}
});
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 82a393d58..45f85b50f 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -238,7 +238,7 @@ class RoomController extends AEnvironmentAwareController {
}
}
- if ($room->getLobbyState() === Webinary::MODERATORS_ONLY &&
+ if ($room->getLobbyState() === Webinary::LOBBY_NON_MODERATORS &&
!$currentParticipant->hasModeratorPermissions()) {
// No participants and chat messages for users in the lobby.
return $roomData;
diff --git a/lib/Middleware/InjectionMiddleware.php b/lib/Middleware/InjectionMiddleware.php
index bb22620fc..86be24691 100644
--- a/lib/Middleware/InjectionMiddleware.php
+++ b/lib/Middleware/InjectionMiddleware.php
@@ -174,7 +174,7 @@ class InjectionMiddleware extends Middleware {
}
$room = $controller->getRoom();
- if (!$room instanceof Room || $room->getLobbyState() !== Webinary::ALL_PARTICIPANTS) {
+ if (!$room instanceof Room || $room->getLobbyState() !== Webinary::LOBBY_NONE) {
throw new LobbyException();
}
}
diff --git a/lib/Room.php b/lib/Room.php
index 0b3c40c4b..b6022ca4f 100644
--- a/lib/Room.php
+++ b/lib/Room.php
@@ -165,7 +165,7 @@ class Room {
protected function validateTimer(): void {
if ($this->lobbyTimer !== null && $this->lobbyTimer < $this->timeFactory->getDateTime()) {
- $this->setLobby(Webinary::ALL_PARTICIPANTS, null, true);
+ $this->setLobby(Webinary::LOBBY_NONE, null, true);
}
}
@@ -523,7 +523,7 @@ class Room {
/**
* @param int $newState Currently it is only allowed to change between
- * `Webinary::MODERATORS_ONLY` and `Webinary::ALL_PARTICIPANTS`
+ * `Webinary::LOBBY_NON_MODERATORS` and `Webinary::LOBBY_NONE`
* Also it's not allowed in one-to-one conversations,
* file conversations and password request conversations.
* @param \DateTime|null $dateTime
@@ -541,7 +541,7 @@ class Room {
return false;
}
- if (!in_array($newState, [Webinary::MODERATORS_ONLY, Webinary::ALL_PARTICIPANTS], true)) {
+ if (!in_array($newState, [Webinary::LOBBY_NON_MODERATORS, Webinary::LOBBY_NONE], true)) {
return false;
}
diff --git a/lib/Webinary.php b/lib/Webinary.php
index f6bb76481..869140db4 100644
--- a/lib/Webinary.php
+++ b/lib/Webinary.php
@@ -25,7 +25,7 @@ namespace OCA\Spreed;
class Webinary {
- public const ALL_PARTICIPANTS = 0;
- public const MODERATORS_ONLY = 1;
+ public const LOBBY_NONE = 0;
+ public const LOBBY_NON_MODERATORS = 1;
}