diff options
Diffstat (limited to 'widgets/msgviewer.go')
-rw-r--r-- | widgets/msgviewer.go | 17 |
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 { |