aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBence Ferdinandy <bence@ferdinandy.com>2024-07-01 21:43:35 +0200
committerRobin Jarry <robin@jarry.cc>2024-08-03 17:42:11 +0200
commit1d4eafb011f46966848d55f381160e846d0d50c8 (patch)
tree95ac8c80255dd65892c1b321047a60c2fc4e8e38 /lib
parent9d8d74d9bf438c337ac0d6eed1b5dede5cc0ceb2 (diff)
downloadaerc-1d4eafb011f46966848d55f381160e846d0d50c8.tar.gz
templates: add {{.AccountFrom}} template
Add template variable to access the current account's From address. Implements: https://todo.sr.ht/~rjarry/aerc/150 Changelog-added: New `{{.AccountFrom}}` template variable. Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib')
-rw-r--r--lib/state/templates.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go
index 868f9184..801de752 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -161,6 +161,13 @@ func (d *templateData) AccountBackend() string {
return ""
}
+func (d *templateData) AccountFrom() *mail.Address {
+ if d.account != nil {
+ return d.account.From
+ }
+ return nil
+}
+
func (d *templateData) Folder() string {
if d.folder != nil {
return d.folder.Name