about summary refs log tree commit diff stats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index 16fe8b7..af51a0f 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -269,11 +269,13 @@ func (aerc *Aerc) Logger() *log.Logger {
 }
 
 func (aerc *Aerc) SelectedAccount() *AccountView {
-	acct, ok := aerc.accounts[aerc.tabs.Tabs[aerc.tabs.Selected].Name]
-	if !ok {
-		return nil
+	switch tab := aerc.SelectedTab().(type) {
+	case *AccountView:
+		return tab
+	case *MessageViewer:
+		return tab.SelectedAccount()
 	}
-	return acct
+	return nil
 }
 
 func (aerc *Aerc) SelectedTab() ui.Drawable {