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.
This commit is contained in:
Ben Burwell 2019-07-07 22:43:57 -04:00 committed by Drew DeVault
parent cce7cb4808
commit 88c379dcba
6 changed files with 41 additions and 41 deletions
worker/imap

View file

@ -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,