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
path: root/lib/IMAP
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-05-08 15:16:00 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-05-08 15:33:57 +0300
commit5b91b1f5b4df2e5603b3facba0b77bf4bcd8612f (patch)
treed00a9f7fb27c9dde531ed82a8e79e9238aff12f9 /lib/IMAP
parent4b519d5b6dd4d1260f133ee4b977a6bd2829fee1 (diff)
Make it possible to mark a folder as read
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/IMAP')
-rw-r--r--lib/IMAP/FolderMapper.php1
-rw-r--r--lib/IMAP/MessageMapper.php10
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/IMAP/FolderMapper.php b/lib/IMAP/FolderMapper.php
index b5821b412..57b74096a 100644
--- a/lib/IMAP/FolderMapper.php
+++ b/lib/IMAP/FolderMapper.php
@@ -25,6 +25,7 @@ namespace OCA\Mail\IMAP;
use function array_filter;
use function array_map;
+use Horde_Imap_Client_Mailbox;
use function reset;
use Horde_Imap_Client;
use Horde_Imap_Client_Exception;
diff --git a/lib/IMAP/MessageMapper.php b/lib/IMAP/MessageMapper.php
index 8e83d2e1c..ef4b672a0 100644
--- a/lib/IMAP/MessageMapper.php
+++ b/lib/IMAP/MessageMapper.php
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace OCA\Mail\IMAP;
+use Horde_Imap_Client;
use Horde_Imap_Client_Base;
use Horde_Imap_Client_Data_Fetch;
use Horde_Imap_Client_Exception;
@@ -87,4 +88,13 @@ class MessageMapper {
]);
}
+ public function markAllRead(Horde_Imap_Client_Base $client,
+ string $mailbox) {
+ $client->store($mailbox, [
+ 'add' => [
+ Horde_Imap_Client::FLAG_SEEN,
+ ],
+ ]);
+ }
+
}