aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/msgviewer.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 91baf025..cefa9bb3 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -303,6 +303,23 @@ func (mv *MessageViewer) SelectedMessagePart() *PartInfo {
}
}
+func (mv *MessageViewer) AttachmentParts() []*PartInfo {
+ var attachments []*PartInfo
+
+ for _, p := range mv.switcher.parts {
+ if p.part.Disposition == "attachment" {
+ pi := &PartInfo{
+ Index: p.index,
+ Msg: p.msg.MessageInfo(),
+ Part: p.part,
+ }
+ attachments = append(attachments, pi)
+ }
+ }
+
+ return attachments
+}
+
func (mv *MessageViewer) PreviousPart() {
switcher := mv.switcher
for {