diff options
author | Joas Schilling <coding@schilljs.com> | 2021-01-19 14:50:45 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2021-02-19 12:45:21 +0300 |
commit | 6ce1e7b47db11583a242ab3608ff6dad1443e38d (patch) | |
tree | 078a7875e3c1677b55172b2d4e8e1e520232a3fd /lib | |
parent | 7cdbd135ac3cddb0b5c2d176f60de6b9979aee0d (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; } /** |