diff options
author | Robin Jarry <robin@jarry.cc> | 2022-12-21 11:31:04 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-04 22:57:31 +0100 |
commit | 5677f93ff8e0f212be112a110fcfe09663c84f98 (patch) | |
tree | 9f47f430b312d1f0dc1acdd3735cfd76ad21e0f0 /worker/maildir/worker.go | |
parent | 36fded03e762da97edde61559c8bf60d5749d6a2 (diff) | |
download | aerc-5677f93ff8e0f212be112a110fcfe09663c84f98.tar.gz |
model: change flags array to bitmask
Using a list of integers is not optimal. Use a bit mask instead.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'worker/maildir/worker.go')
-rw-r--r-- | worker/maildir/worker.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go index 8c4d78ab..54069538 100644 --- a/worker/maildir/worker.go +++ b/worker/maildir/worker.go @@ -712,7 +712,7 @@ func (w *Worker) handleFlagMessages(msg *types.FlagMessages) error { w.err(msg, err) continue } - flag := lib.FlagToMaildir[msg.Flag] + flag := lib.FlagToMaildir[msg.Flags] if err := m.SetOneFlag(flag, msg.Enable); err != nil { log.Errorf("could change flag %v to %v on message: %v", flag, msg.Enable, err) w.err(msg, err) @@ -817,7 +817,7 @@ func (w *Worker) msgInfoFromUid(uid uint32) (*models.MessageInfo, error) { return nil, err } if w.c.IsRecent(uid) { - info.Flags = append(info.Flags, models.RecentFlag) + info.Flags |= models.RecentFlag } return info, nil } |