From 5c7d4873908f28dde33013d10543e4cf1417525b Mon Sep 17 00:00:00 2001 From: Shivesh Mandalia Date: Sat, 23 Oct 2021 18:37:06 +0100 Subject: Implement interface for my custom IMAP flags --- lib/msgstore.go | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'lib/msgstore.go') diff --git a/lib/msgstore.go b/lib/msgstore.go index 7af9fd2..222c9fc 100644 --- a/lib/msgstore.go +++ b/lib/msgstore.go @@ -361,6 +361,79 @@ func (store *MessageStore) Answered(uids []uint32, answered bool, }, cb) } +// NOTE(shivesh): my custom flags +func (store *MessageStore) Important(uids []uint32, important bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.ImportantMessages{ + Important: important, + Uids: uids, + }, cb) +} + +func (store *MessageStore) List(uids []uint32, list bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.ListMessages{ + List: list, + Uids: uids, + }, cb) +} + +func (store *MessageStore) Food(uids []uint32, food bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.FoodMessages{ + Food: food, + Uids: uids, + }, cb) +} + +func (store *MessageStore) Personal(uids []uint32, personal bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.PersonalMessages{ + Personal: personal, + Uids: uids, + }, cb) +} + +func (store *MessageStore) Work(uids []uint32, work bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.WorkMessages{ + Work: work, + Uids: uids, + }, cb) +} + +func (store *MessageStore) Physics(uids []uint32, physics bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.PhysicsMessages{ + Physics: physics, + Uids: uids, + }, cb) +} + +func (store *MessageStore) Todo(uids []uint32, todo bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.TodoMessages{ + Todo: todo, + Uids: uids, + }, cb) +} + +func (store *MessageStore) Later(uids []uint32, later bool, + cb func(msg types.WorkerMessage)) { + + store.worker.PostAction(&types.LaterMessages{ + Later: later, + Uids: uids, + }, cb) +} + func (store *MessageStore) Uids() []uint32 { if store.filter { return store.results -- cgit v1.2.3