From 930e50328c3a57faeec7fd23881e044257eda157 Mon Sep 17 00:00:00 2001 From: Bence Ferdinandy Date: Sat, 30 Dec 2023 16:50:42 +0100 Subject: templates: add full path of file(s) as Filename(s) For the maildir and notmuch backends, add the full path of the message as Filename to templates. In case of a notmuch message having multiple files associated with it, it returns a random path. Also add Filenames to templates, which is a list of all associated message paths. This is relevant for the notmuch backend, where a single messages is shown, if there are multiple copies of it. Changelog-added: Add filepath to messages in templates as .Filename(s) Signed-off-by: Bence Ferdinandy Acked-by: Robin Jarry --- models/models.go | 1 + models/templates.go | 2 ++ 2 files changed, 3 insertions(+) (limited to 'models') diff --git a/models/models.go b/models/models.go index 42e60b8b..55dd2347 100644 --- a/models/models.go +++ b/models/models.go @@ -97,6 +97,7 @@ type MessageInfo struct { Envelope *Envelope Flags Flags Labels []string + Filenames []string InternalDate time.Time RFC822Headers *mail.Header Refs []string diff --git a/models/templates.go b/models/templates.go index d6b90e88..77f6b787 100644 --- a/models/templates.go +++ b/models/templates.go @@ -28,6 +28,8 @@ type TemplateData interface { SubjectBase() string Number() int Labels() []string + Filename() string + Filenames() []string Flags() []string IsReplied() bool HasAttachment() bool -- cgit