diff options
author | Reto Brunner <reto@labrat.space> | 2020-10-14 08:42:26 +0200 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-10-14 08:42:26 +0200 |
commit | 75cbf767326dfc67325773850ab1f6451dc9fb14 (patch) | |
tree | 4b47de3da4944ed2a84a7f175a742fda3dd2ea24 /config | |
parent | b6bcf89784605aa8baa982677de9d8d8ddbaa404 (diff) | |
download | aerc-75cbf767326dfc67325773850ab1f6451dc9fb14.tar.gz |
refactor ParseMessageFormat to use a ctx object
Diffstat (limited to 'config')
-rw-r--r-- | config/triggers.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/config/triggers.go b/config/triggers.go index 3187cf7..847a10f 100644 --- a/config/triggers.go +++ b/config/triggers.go @@ -37,9 +37,12 @@ func (trig *TriggersConfig) ExecNewEmail(account *AccountConfig, err := trig.ExecTrigger(trig.NewEmail, func(part string) (string, error) { formatstr, args, err := format.ParseMessageFormat( - account.From, - part, - conf.Ui.TimestampFormat, account.Name, 0, msg, false) + part, conf.Ui.TimestampFormat, + format.Ctx{ + FromAddress: account.From, + AccountName: account.Name, + MsgInfo: msg}, + ) if err != nil { return "", err } |