about summary refs log tree commit diff stats
path: root/worker/imap/flags.go
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-07-07 22:43:57 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-08 16:06:26 -0400
commit88c379dcbaaf9fd549cd271817e79fe634b1dd84 (patch)
tree5b12c811aa5a96ebe8debc1cb4067e32ea237698 /worker/imap/flags.go
parentcce7cb48081ca090ac2d3a0e781dfbc25d581946 (diff)
downloadaerc-88c379dcbaaf9fd549cd271817e79fe634b1dd84.tar.gz
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.go6
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,