From 75cbf767326dfc67325773850ab1f6451dc9fb14 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Wed, 14 Oct 2020 08:42:26 +0200 Subject: refactor ParseMessageFormat to use a ctx object --- config/triggers.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'config') 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 } -- cgit 1.4.1-2-gfad0