about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2019-12-18 06:33:58 +0100
committerDrew DeVault <sir@cmpwn.com>2019-12-21 09:27:49 -0500
commit3e535f49b314979615e7ce76573fa76f9ab71b00 (patch)
tree7ba0a5737d44eddfbea2042efb06e510fe397e67
parent98418764b640d37e17caf537498f5436cfd8cda3 (diff)
downloadaerc-3e535f49b314979615e7ce76573fa76f9ab71b00.tar.gz
msgviewer: implement ProvidesMessages interface
-rw-r--r--widgets/msgviewer.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index b573201..ee7dd50 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -25,6 +25,8 @@ import (
 
 var ansi = regexp.MustCompile("^\x1B\\[[0-?]*[ -/]*[@-~]")
 
+var _ ProvidesMessages = (*MessageViewer)(nil)
+
 type MessageViewer struct {
 	ui.Invalidatable
 	acct     *AccountView
@@ -232,6 +234,11 @@ func (mv *MessageViewer) SelectedMessage() (*models.MessageInfo, error) {
 	return mv.msg, nil
 }
 
+func (mv *MessageViewer) MarkedMessages() ([]*models.MessageInfo, error) {
+	store := mv.Store()
+	return msgInfoFromUids(store, store.Marked())
+}
+
 func (mv *MessageViewer) ToggleHeaders() {
 	switcher := mv.switcher
 	mv.conf.Viewer.ShowHeaders = !mv.conf.Viewer.ShowHeaders