aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorinwit <inwit@sindominio.net>2024-06-29 17:14:24 +0200
committerRobin Jarry <robin@jarry.cc>2024-08-20 11:54:34 +0200
commit930cece51d6522e4b34504895926029eab5e3f5b (patch)
tree21a6fae923f72120745e19a739ac09dd5fe77c0b /lib
parentfd81f2c81e3c31118fc7df14c3e208cc112c36b9 (diff)
downloadaerc-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')
-rw-r--r--lib/state/templates.go10
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 {