aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/msgviewer.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r--widgets/msgviewer.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index e0fe6aac..d31e0512 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -199,6 +199,18 @@ func (mv *MessageViewer) OnInvalidate(fn func(d ui.Drawable)) {
})
}
+func (mv *MessageViewer) CurrentPart() *PartInfo {
+ switcher := mv.switcher
+ part := switcher.parts[switcher.selected]
+
+ return &PartInfo{
+ Index: part.index,
+ Msg: part.msg,
+ Part: part.part,
+ Store: part.store,
+ }
+}
+
func (mv *MessageViewer) PreviousPart() {
switcher := mv.switcher
for {
@@ -291,6 +303,13 @@ type PartViewer struct {
term *Terminal
}
+type PartInfo struct {
+ Index []int
+ Msg *types.MessageInfo
+ Part *imap.BodyStructure
+ Store *lib.MessageStore
+}
+
func NewPartViewer(conf *config.AercConfig,
store *lib.MessageStore, msg *types.MessageInfo,
part *imap.BodyStructure, index []int) (*PartViewer, error) {