add LabelList event

This commit is contained in:
Reto Brunner 2019-12-21 16:21:25 +01:00 committed by Drew DeVault
parent 709d4e1e59
commit 2705d8460d
2 changed files with 12 additions and 0 deletions

View file

@ -23,6 +23,7 @@ type AccountView struct {
aerc *Aerc aerc *Aerc
conf *config.AercConfig conf *config.AercConfig
dirlist *DirectoryList dirlist *DirectoryList
labels []string
grid *ui.Grid grid *ui.Grid
host TabHost host TabHost
logger *log.Logger logger *log.Logger
@ -169,6 +170,10 @@ func (acct *AccountView) Directories() *DirectoryList {
return acct.dirlist return acct.dirlist
} }
func (acct *AccountView) Labels() []string {
return acct.labels
}
func (acct *AccountView) Messages() *MessageList { func (acct *AccountView) Messages() *MessageList {
return acct.msglist return acct.msglist
} }
@ -257,6 +262,8 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
if store, ok := acct.dirlist.SelectedMsgStore(); ok { if store, ok := acct.dirlist.SelectedMsgStore(); ok {
store.Update(msg) store.Update(msg)
} }
case *types.LabelList:
acct.labels = msg.Labels
case *types.Error: case *types.Error:
acct.logger.Printf("%v", msg.Error) acct.logger.Printf("%v", msg.Error)
acct.host.SetStatus(fmt.Sprintf("%v", msg.Error)). acct.host.SetStatus(fmt.Sprintf("%v", msg.Error)).

View file

@ -183,3 +183,8 @@ type ModifyLabels struct {
Add []string Add []string
Remove []string Remove []string
} }
type LabelList struct {
Message
Labels []string
}