Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 17:07:20 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-03-26 17:21:33 +0300
commit2da6472563f6cb2226dc5ce053f11f1bbcdb7d10 (patch)
tree04e4706835e861b7f53439bb180b443c4cef8d22 /lib/Controller/MessagesController.php
parent5beabd985681ed6c9bb58c874d8fa8516fbdfe92 (diff)
Refactor message flag logic into a service method
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Controller/MessagesController.php')
-rwxr-xr-xlib/Controller/MessagesController.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Controller/MessagesController.php b/lib/Controller/MessagesController.php
index d431539c5..2851e37c4 100755
--- a/lib/Controller/MessagesController.php
+++ b/lib/Controller/MessagesController.php
@@ -449,7 +449,7 @@ class MessagesController extends Controller {
* @throws ServiceException
*/
public function setFlags(int $accountId, string $folderId, int $messageId, array $flags): JSONResponse {
- $mailBox = $this->getFolder($accountId, $folderId);
+ $account = $this->accountService->find($this->currentUserId, $accountId);
foreach ($flags as $flag => $value) {
$value = filter_var($value, FILTER_VALIDATE_BOOLEAN);
@@ -457,7 +457,7 @@ class MessagesController extends Controller {
$flag = 'seen';
$value = !$value;
}
- $mailBox->setMessageFlag($messageId, '\\' . $flag, $value);
+ $this->mailManager->flagMessage($account, base64_decode($folderId), $messageId, $flag, $value);
}
return new JSONResponse();
}
@@ -493,6 +493,7 @@ class MessagesController extends Controller {
* @param string $folderId
*
* @return IMailBox
+ * @deprecated
*
* @throws ClientException
* @throws ServiceException