~sircmpwn/aerc

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Fix selected account to return for messageviewer

Details
Message ID
<20191001170148.40696-1-dev@jeffas.io>
DKIM signature
missing
Download raw message
Patch: +6 -4
This ensures that the selectedaccount is returned if currently selected
tab is a messageviewer. This also makes it more extensible for adding
other ways of getting the selected account.
---

Hopefully fixes https://todo.sr.ht/~sircmpwn/aerc2/255#comment-3921

 widgets/aerc.go | 10 ++++++----
 1 file 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 {
--
2.23.0
Details
Message ID
<BXFALO0ERD29.1P6AXMXU23V63@koishi>
In-Reply-To
<20191001170148.40696-1-dev@jeffas.io> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git.sr.ht:~sircmpwn/aerc
   f15811a..00b9ca5  master -> master
Reply to thread Export thread (mbox)