From 5677f93ff8e0f212be112a110fcfe09663c84f98 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Wed, 21 Dec 2022 11:31:04 +0100 Subject: model: change flags array to bitmask Using a list of integers is not optimal. Use a bit mask instead. Signed-off-by: Robin Jarry Acked-by: Tim Culverhouse --- worker/imap/flags.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'worker/imap/flags.go') diff --git a/worker/imap/flags.go b/worker/imap/flags.go index 9d9ecc86..180bc261 100644 --- a/worker/imap/flags.go +++ b/worker/imap/flags.go @@ -34,7 +34,6 @@ func (imapw *IMAPWorker) handleAnsweredMessages(msg *types.AnsweredMessages) { flags := []interface{}{imap.AnsweredFlag} if !msg.Answered { item = imap.FormatFlagsOp(imap.RemoveFlags, false) - flags = []interface{}{imap.AnsweredFlag} } imapw.handleStoreOps(msg, msg.Uids, item, flags, func(_msg *imap.Message) error { @@ -50,7 +49,7 @@ func (imapw *IMAPWorker) handleAnsweredMessages(msg *types.AnsweredMessages) { } func (imapw *IMAPWorker) handleFlagMessages(msg *types.FlagMessages) { - flags := []interface{}{flagToImap[msg.Flag]} + flags := []interface{}{flagToImap[msg.Flags]} item := imap.FormatFlagsOp(imap.AddFlags, false) if !msg.Enable { item = imap.FormatFlagsOp(imap.RemoveFlags, false) -- cgit