diff options
author | inwit <inwit@sindominio.net> | 2024-06-29 17:14:24 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-08-20 11:54:34 +0200 |
commit | 930cece51d6522e4b34504895926029eab5e3f5b (patch) | |
tree | 21a6fae923f72120745e19a739ac09dd5fe77c0b /lib/state/templates.go | |
parent | fd81f2c81e3c31118fc7df14c3e208cc112c36b9 (diff) | |
download | aerc-930cece51d6522e4b34504895926029eab5e3f5b.tar.gz |
templates: add a template for forwaded messages
Add a {{.IsForwarded}} template to tell if a message has been forwarded
or not.
Changelog-added: Forwarded messages can be identified with the
{{.IsForwarded}} template.
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/state/templates.go')
-rw-r--r-- | lib/state/templates.go | 10 |
1 files changed, 10 insertions, 0 deletions
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 { |