From 3e535f49b314979615e7ce76573fa76f9ab71b00 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Wed, 18 Dec 2019 06:33:58 +0100 Subject: msgviewer: implement ProvidesMessages interface --- widgets/msgviewer.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'widgets') 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 -- cgit v1.2.3