summary refs log tree commit diff stats
path: root/lib/msgstore.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-06-09 14:55:34 -0400
committerDrew DeVault <sir@cmpwn.com>2019-06-09 14:55:42 -0400
commit6271d455eb7d72ca2942e3721721be54fed27779 (patch)
treef5c37e55333f2fb1807b6a41fc6093838a134adc /lib/msgstore.go
parent05f00f0153066b9bb527773927a3244dad28ef4f (diff)
downloadaerc-6271d455eb7d72ca2942e3721721be54fed27779.tar.gz
Add :read and :unread commands
Diffstat (limited to 'lib/msgstore.go')
-rw-r--r--lib/msgstore.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 56725e3..5b4d540 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -265,3 +265,17 @@ func (store *MessageStore) Move(uids []uint32, dest string, createDest bool,
 
 	store.update()
 }
+
+func (store *MessageStore) Read(uids []uint32, read bool,
+	cb func(msg types.WorkerMessage)) {
+
+	var set imap.SeqSet
+	for _, uid := range uids {
+		set.AddNum(uid)
+	}
+
+	store.worker.PostAction(&types.ReadMessages{
+		Read: read,
+		Uids: set,
+	}, cb)
+}