diff options
-rw-r--r-- | config/templates.go | 1 | ||||
-rw-r--r-- | doc/aerc-templates.7.scd | 4 | ||||
-rw-r--r-- | lib/state/templates.go | 10 | ||||
-rw-r--r-- | models/templates.go | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/config/templates.go b/config/templates.go index a74386cf..fd7f0186 100644 --- a/config/templates.go +++ b/config/templates.go @@ -99,6 +99,7 @@ func (d *dummyData) IsUnread() bool { return false } func (d *dummyData) IsFlagged() bool { return false } func (d *dummyData) IsDraft() bool { return false } func (d *dummyData) IsMarked() bool { return false } +func (d *dummyData) IsForwarded() bool { return false } func (d *dummyData) MessageId() string { return "123456789@foo.org" } func (d *dummyData) Size() int { return 420 } func (d *dummyData) OriginalText() string { return "Blah blah blah" } diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd index de160293..898688fb 100644 --- a/doc/aerc-templates.7.scd +++ b/doc/aerc-templates.7.scd @@ -116,8 +116,8 @@ available always. {{.Flags | join ""}} ``` -*IsReplied*, *HasAttachment*, *IsFlagged*, *IsRecent*, *IsUnread*, *IsMarked*, -*IsDraft* +*IsReplied*, *IsForwarded*, *HasAttachment*, *IsFlagged*, *IsRecent*, *IsUnread*, +*IsMarked*, *IsDraft* Individual boolean flags. not available when composing, replying nor forwarding. diff --git a/lib/state/templates.go b/lib/state/templates.go index 390ab131..c208dff2 100644 --- a/lib/state/templates.go +++ b/lib/state/templates.go @@ -418,6 +418,9 @@ func (d *templateData) Flags() []string { if d.info.Flags.Has(models.DeletedFlag) { flags = append(flags, d.ui().IconDeleted) } + if d.info.Flags.Has(models.ForwardedFlag) { + flags = append(flags, d.ui().IconForwarded) + } if d.info.BodyStructure != nil { for _, bS := range d.info.BodyStructure.Parts { if strings.ToLower(bS.Disposition) == "attachment" { @@ -442,6 +445,13 @@ func (d *templateData) IsReplied() bool { return false } +func (d *templateData) IsForwarded() bool { + if d.info != nil && d.info.Flags.Has(models.ForwardedFlag) { + return true + } + return false +} + func (d *templateData) HasAttachment() bool { if d.info != nil && d.info.BodyStructure != nil { for _, bS := range d.info.BodyStructure.Parts { diff --git a/models/templates.go b/models/templates.go index 27a3ca6e..566fdb14 100644 --- a/models/templates.go +++ b/models/templates.go @@ -42,6 +42,7 @@ type TemplateData interface { IsUnread() bool IsMarked() bool IsDraft() bool + IsForwarded() bool MessageId() string Role() string Size() int |