diff options
author | Ben Burwell <ben@benburwell.com> | 2019-07-03 18:11:33 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-07-04 22:20:24 -0400 |
commit | dccdea1e026edc2bc9c5dc27604e85ce333d65bc (patch) | |
tree | abc531253bbf4571290d8729f039e2cf28afc4d8 /worker/imap/flags.go | |
parent | 91529df0fecc68d5b0fdbb682529ee545884e7c5 (diff) |
Use []uint32 instead of imap.SeqSet
A sequence-set is an IMAP-specific implementation detail. Throughout the
UI, aerc simply operates using lists of opaque identifiers. In order to
loosen the coupling between the UI and IMAP in particular, replace most
usages of imap.SeqSet with []uint32, leaving the translation to a SeqSet
to the IMAP backend as needed.
Diffstat (limited to 'worker/imap/flags.go')
-rw-r--r-- | worker/imap/flags.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/worker/imap/flags.go b/worker/imap/flags.go index 0122d8e..57211a6 100644 --- a/worker/imap/flags.go +++ b/worker/imap/flags.go @@ -9,7 +9,8 @@ import ( func (imapw *IMAPWorker) handleDeleteMessages(msg *types.DeleteMessages) { item := imap.FormatFlagsOp(imap.AddFlags, true) flags := []interface{}{imap.DeletedFlag} - if err := imapw.client.UidStore(&msg.Uids, item, flags, nil); err != nil { + uids := toSeqSet(msg.Uids) + if err := imapw.client.UidStore(uids, item, flags, nil); err != nil { imapw.worker.PostMessage(&types.Error{ Message: types.RespondTo(msg), Error: err, @@ -49,7 +50,8 @@ func (imapw *IMAPWorker) handleReadMessages(msg *types.ReadMessages) { item = imap.FormatFlagsOp(imap.RemoveFlags, true) flags = []interface{}{imap.SeenFlag} } - if err := imapw.client.UidStore(&msg.Uids, item, flags, nil); err != nil { + uids := toSeqSet(msg.Uids) + if err := imapw.client.UidStore(uids, item, flags, nil); err != nil { imapw.worker.PostMessage(&types.Error{ Message: types.RespondTo(msg), Error: err, |