From 24d268d1073e09ac7dedd8a7c71da2c3f4e76a85 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 14 Jul 2020 16:30:50 +0200 Subject: Add a REST resource to fetch a thread Signed-off-by: Christoph Wurst --- lib/Controller/MessagesController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/Controller/MessagesController.php') diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php index 7e813bbe6..ef6357835 100755 --- a/lib/Controller/MessagesController.php +++ b/lib/Controller/MessagesController.php @@ -234,6 +234,23 @@ class MessagesController extends Controller { return new JSONResponse($json); } + /** + * @NoAdminRequired + * @NoCSRFRequired + * @TrapError + * + * @param int $accountId + * @param string $folderId + * + * @return JSONResponse + * @throws ClientException + */ + public function getThread(int $accountId, int $id): JSONResponse { + $account = $this->accountService->find($this->currentUserId, $accountId); + + return new JSONResponse($this->mailManager->getThread($account, $id)); + } + /** * @NoAdminRequired * @TrapError -- cgit v1.2.3