ILIAS  release_8 Revision v8.23
class.ilChatroomClearGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
29 {
30  public function executeDefault(string $requestedMethod): void
31  {
32  $this->redirectIfNoPermission('moderate');
33 
34  $room = $this->getRoomByObjectId($this->gui->getObject()->getId());
35  $this->exitIfNoRoomExists($room);
36 
37  $chat_user = new ilChatroomUser($this->ilUser, $room);
38  $subRoomId = $this->getRequestValue('sub', $this->refinery->kindlyTo()->int());
39 
40  $room->clearMessages($subRoomId);
41 
42  $connector = $this->gui->getConnector();
43  $response = $connector->sendClearMessages($room->getRoomId(), $subRoomId, $chat_user->getUserId());
44 
45  $this->sendResponse($response);
46  }
47 }
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
getRequestValue(string $key, Transformation $trafo, $default=null)
exitIfNoRoomExists(?ilChatroom $room)
Checks if a ilChatroom exists.
Class ilChatroomGUIHandler.
executeDefault(string $requestedMethod)
sendResponse($response, bool $isJson=false)
Sends a json encoded response and exits the php process.
Class ilChatroomUser.
$response
Class ilChatroomKickGUI.