widget: Add ProvidesMessage interface

Consists of 3 functions
* Store: Access to MessageStore type
* SelectedAccount: Access to Account widget that the target widget
belongs to
* SelectedMessage: Current message (selected in msglist or the one we
are viewing)

Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
This commit is contained in:
Kevin Kuehler 2019-06-01 22:15:04 -07:00 committed by Drew DeVault
parent 2be985fecb
commit 753adb9069
10 changed files with 93 additions and 18 deletions

View file

@ -13,6 +13,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/commands"
"git.sr.ht/~sircmpwn/aerc/commands/account"
"git.sr.ht/~sircmpwn/aerc/commands/compose"
"git.sr.ht/~sircmpwn/aerc/commands/msg"
"git.sr.ht/~sircmpwn/aerc/commands/msgview"
"git.sr.ht/~sircmpwn/aerc/commands/terminal"
"git.sr.ht/~sircmpwn/aerc/config"
@ -25,6 +26,7 @@ func getCommands(selected libui.Drawable) []*commands.Commands {
case *widgets.AccountView:
return []*commands.Commands{
account.AccountCommands,
msg.MessageCommands,
commands.GlobalCommands,
}
case *widgets.Composer:
@ -35,6 +37,7 @@ func getCommands(selected libui.Drawable) []*commands.Commands {
case *widgets.MessageViewer:
return []*commands.Commands{
msgview.MessageViewCommands,
msg.MessageCommands,
commands.GlobalCommands,
}
case *widgets.Terminal: