Fix: Use derivation function for template fields

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-09-03 00:13:28 +02:00
parent 7b921e1b3e
commit df9fe579ea
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -31,12 +31,9 @@ func formatMessage(tplString string, m *irc.Message, r *plugins.Rule, fields plu
if m != nil { if m != nil {
compiledFields["msg"] = m compiledFields["msg"] = m
compiledFields["username"] = m.User
if len(m.Params) > 0 {
compiledFields["channel"] = m.Params[0]
}
} }
compiledFields["username"] = plugins.DeriveUser(m, fields)
compiledFields["channel"] = plugins.DeriveChannel(m, fields)
// Parse and execute template // Parse and execute template
tpl, err := template. tpl, err := template.