From 2705d8460d7e974ee01ad41ce063ae3feeb30317 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 21 Dec 2019 16:21:25 +0100 Subject: add LabelList event --- widgets/account.go | 7 +++++++ worker/types/messages.go | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/widgets/account.go b/widgets/account.go index bf3f617..404a9ea 100644 --- a/widgets/account.go +++ b/widgets/account.go @@ -23,6 +23,7 @@ type AccountView struct { aerc *Aerc conf *config.AercConfig dirlist *DirectoryList + labels []string grid *ui.Grid host TabHost logger *log.Logger @@ -169,6 +170,10 @@ func (acct *AccountView) Directories() *DirectoryList { return acct.dirlist } +func (acct *AccountView) Labels() []string { + return acct.labels +} + func (acct *AccountView) Messages() *MessageList { return acct.msglist } @@ -257,6 +262,8 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) { if store, ok := acct.dirlist.SelectedMsgStore(); ok { store.Update(msg) } + case *types.LabelList: + acct.labels = msg.Labels case *types.Error: acct.logger.Printf("%v", msg.Error) acct.host.SetStatus(fmt.Sprintf("%v", msg.Error)). diff --git a/worker/types/messages.go b/worker/types/messages.go index 3539139..a38ff94 100644 --- a/worker/types/messages.go +++ b/worker/types/messages.go @@ -183,3 +183,8 @@ type ModifyLabels struct { Add []string Remove []string } + +type LabelList struct { + Message + Labels []string +} -- cgit v1.2.3