aboutsummaryrefslogtreecommitdiffstats
path: root/config/triggers.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-10-14 08:42:26 +0200
committerReto Brunner <reto@labrat.space>2020-10-14 08:42:26 +0200
commit75cbf767326dfc67325773850ab1f6451dc9fb14 (patch)
tree4b47de3da4944ed2a84a7f175a742fda3dd2ea24 /config/triggers.go
parentb6bcf89784605aa8baa982677de9d8d8ddbaa404 (diff)
downloadaerc-75cbf767326dfc67325773850ab1f6451dc9fb14.tar.gz
refactor ParseMessageFormat to use a ctx object
Diffstat (limited to 'config/triggers.go')
-rw-r--r--config/triggers.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/config/triggers.go b/config/triggers.go
index 3187cf7b..847a10f3 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
}