diff options
author | Joas Schilling <coding@schilljs.com> | 2021-01-19 14:50:45 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-02-02 15:52:25 +0300 |
commit | 47c76fa9eb6d57770b69d07e4a7a6215e3fe4436 (patch) | |
tree | cbcdf160ac1c0e0ed2051fdf4339b81804d9f066 /lib | |
parent | 5db677377a6f525ed9ad6db46b705f6e40df8d12 (diff) |
Add docs and restrict deleting to non-lobby and read-write chats
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/ChatController.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php index cbdd754b7..34476b53c 100644 --- a/lib/Controller/ChatController.php +++ b/lib/Controller/ChatController.php @@ -471,6 +471,8 @@ class ChatController extends AEnvironmentAwareController { /** * @NoAdminRequired * @RequireParticipant + * @RequireReadWriteConversation + * @RequireModeratorOrNoLobby * * @param int $messageId * @return DataResponse @@ -516,7 +518,12 @@ class ChatController extends AEnvironmentAwareController { $data['parent'] = $message->toArray(); $bridge = $this->matterbridgeManager->getBridgeOfRoom($this->room); - return new DataResponse($data, $bridge['enabled'] ? Http::STATUS_ACCEPTED: Http::STATUS_OK); + + $response = new DataResponse($data, $bridge['enabled'] ? Http::STATUS_ACCEPTED: Http::STATUS_OK); + if ($this->participant->getAttendee()->getReadPrivacy() === Participant::PRIVACY_PUBLIC) { + $response->addHeader('X-Chat-Last-Common-Read', $this->chatManager->getLastCommonReadMessage($this->room)); + } + return $response; } /** |