aboutsummaryrefslogtreecommitdiff
path: root/lib/state/templates.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/state/templates.go')
-rw-r--r--lib/state/templates.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go
index b0daa2cc..8c7df3e8 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -336,6 +336,49 @@ func (d *templateData) Flags() []string {
return flags
}
+func (d *templateData) IsReplied() bool {
+ if d.info != nil && d.info.Flags.Has(models.AnsweredFlag) {
+ return true
+ }
+ return false
+}
+
+func (d *templateData) HasAttachment() bool {
+ if d.info != nil && d.info.BodyStructure != nil {
+ for _, bS := range d.info.BodyStructure.Parts {
+ if strings.ToLower(bS.Disposition) == "attachment" {
+ return true
+ }
+ }
+ }
+ return false
+}
+
+func (d *templateData) IsRecent() bool {
+ if d.info != nil && d.info.Flags.Has(models.RecentFlag) {
+ return true
+ }
+ return false
+}
+
+func (d *templateData) IsUnread() bool {
+ if d.info != nil && !d.info.Flags.Has(models.SeenFlag) {
+ return true
+ }
+ return false
+}
+
+func (d *templateData) IsFlagged() bool {
+ if d.info != nil && d.info.Flags.Has(models.FlaggedFlag) {
+ return true
+ }
+ return false
+}
+
+func (d *templateData) IsMarked() bool {
+ return d.marked
+}
+
func (d *templateData) MessageId() string {
if d.info == nil || d.info.Envelope == nil {
return ""