diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-08 15:16:00 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2019-05-08 15:33:57 +0300 |
commit | 5b91b1f5b4df2e5603b3facba0b77bf4bcd8612f (patch) | |
tree | d00a9f7fb27c9dde531ed82a8e79e9238aff12f9 /lib/IMAP | |
parent | 4b519d5b6dd4d1260f133ee4b977a6bd2829fee1 (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.php | 1 | ||||
-rw-r--r-- | lib/IMAP/MessageMapper.php | 10 |
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, + ], + ]); + } + } |