From 1d5e5b49c1485e9be70f22c4df9526805f5238a7 Mon Sep 17 00:00:00 2001 From: SebastianKrupinski Date: Tue, 5 Nov 2024 18:40:16 -0500 Subject: [PATCH] fix: Junk/NotJunk flags Signed-off-by: SebastianKrupinski --- lib/Service/MailManager.php | 4 +++- src/store/actions.js | 4 ++-- tests/Unit/Service/MailManagerTest.php | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Service/MailManager.php b/lib/Service/MailManager.php index 7fd3cf7827..6102ed6a34 100644 --- a/lib/Service/MailManager.php +++ b/lib/Service/MailManager.php @@ -53,11 +53,13 @@ class MailManager implements IMailManager { private const ALLOWED_FLAGS = [ 'seen' => [Horde_Imap_Client::FLAG_SEEN], 'answered' => [Horde_Imap_Client::FLAG_ANSWERED], + 'forwarded' => [Horde_Imap_Client::FLAG_FORWARDED], 'flagged' => [Horde_Imap_Client::FLAG_FLAGGED], 'deleted' => [Horde_Imap_Client::FLAG_DELETED], 'draft' => [Horde_Imap_Client::FLAG_DRAFT], 'recent' => [Horde_Imap_Client::FLAG_RECENT], - 'junk' => [Horde_Imap_Client::FLAG_JUNK, 'junk'], + 'junk' => [Horde_Imap_Client::FLAG_JUNK], + 'notjunk' => [Horde_Imap_Client::FLAG_NOTJUNK,], 'mdnsent' => [Horde_Imap_Client::FLAG_MDNSENT], ]; diff --git a/src/store/actions.js b/src/store/actions.js index a6324b58cf..fa18692239 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -998,8 +998,8 @@ export default { try { await setEnvelopeFlags(envelope.databaseId, { - $junk: !oldState, - $notjunk: oldState, + junk: !oldState, + notjunk: oldState, }) } catch (error) { console.error('could not toggle message junk state', error) diff --git a/tests/Unit/Service/MailManagerTest.php b/tests/Unit/Service/MailManagerTest.php index 7c390d253c..a034e78f90 100644 --- a/tests/Unit/Service/MailManagerTest.php +++ b/tests/Unit/Service/MailManagerTest.php @@ -332,11 +332,13 @@ public function testFilterFlagStandard(): void { $flags = [ 'seen' => [\Horde_Imap_Client::FLAG_SEEN], 'answered' => [\Horde_Imap_Client::FLAG_ANSWERED], + 'forwarded' => [\Horde_Imap_Client::FLAG_FORWARDED], 'flagged' => [\Horde_Imap_Client::FLAG_FLAGGED], 'deleted' => [\Horde_Imap_Client::FLAG_DELETED], 'draft' => [\Horde_Imap_Client::FLAG_DRAFT], 'recent' => [\Horde_Imap_Client::FLAG_RECENT], - 'junk' => [\Horde_Imap_Client::FLAG_JUNK, 'junk'], + 'junk' => [\Horde_Imap_Client::FLAG_JUNK], + 'notjunk' => [\Horde_Imap_Client::FLAG_NOTJUNK], 'mdnsent' => [\Horde_Imap_Client::FLAG_MDNSENT], ];