19 declare(strict_types=1);
34 'reason' =>
'not allowed enter to private room' 44 'reason' =>
'not subscribed' 66 $subRoomId = $room->addPrivateRoom($title, $chat_user, [
'public' =>
false]);
68 $connector = $this->gui->getConnector();
69 $response = $connector->sendCreatePrivateRoom($room->getRoomId(), $subRoomId, $chat_user->getUserId(), $title);
75 'owner' => $chat_user->getUserId(),
76 'subRoomId' => $subRoomId
83 public function delete():
void 93 $room->closePrivateRoom($subRoom);
95 $connector = $this->gui->getConnector();
96 $response = $connector->sendDeletePrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
113 $connector = $this->gui->getConnector();
114 $response = $connector->sendLeavePrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
116 if ($room->userIsInPrivateRoom($subRoom, $chat_user->getUserId())) {
117 $room->unsubscribeUserFromPrivateRoom($subRoom, $chat_user->getUserId());
134 $connector = $this->gui->getConnector();
135 $response = $connector->sendEnterPrivateRoom($room->getRoomId(), $subRoom, $chat_user->getUserId());
138 $room->subscribeUserToPrivateRoom($subRoom, $chat_user->getUserId());
151 $response = $room->listUsersInPrivateRoom(
getUserId()
Returns Ilias User ID.
Class ilChatroomPrivateRoomGUI.
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getRequestValue(string $key, Transformation $trafo, $default=null)
exitIfNoRoomExists(?ilChatroom $room)
Checks if a ilChatroom exists.
exitIfEnterRoomIsNotAllowed(ilChatroom $room, int $subRoom, ilChatroomUser $chat_user)
Class ilChatroomGUIHandler.
isSubscribed(int $chat_userid)
exitIfNoRoomSubscription(ilChatroom $room, ilChatroomUser $chat_user)
isSuccessful($response)
Checks for success param in an json decoded response.
isAllowedToEnterPrivateRoom(int $chat_userid, int $proom_id)
sendResponse($response, bool $isJson=false)
Sends a json encoded response and exits the php process.
static byObjectId(int $object_id)
executeDefault(string $requestedMethod)