Software /
code /
prosody-modules
Diff
mod_watchuntrusted/mod_watchuntrusted.lua @ 2887:65082d91950e
Many modules: Simplify st.message(…):tag("body"):text(…):up() into st.message(…, …)
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 17 Feb 2018 08:42:10 +0100 |
parent | 2810:9a3e51f348fe |
child | 3020:ec671ad1a8a9 |
line wrap: on
line diff
--- a/mod_watchuntrusted/mod_watchuntrusted.lua Tue Feb 20 17:30:17 2018 +0100 +++ b/mod_watchuntrusted/mod_watchuntrusted.lua Sat Feb 17 08:42:10 2018 +0100 @@ -49,11 +49,10 @@ errors = error_message }; - local message = st.message{ type = "chat", from = local_host } - :tag("body") - :text(untrusted_fail_notification:gsub("%$([%w_]+)", function (v) - return event[v] or session and session[v] or replacements and replacements[v] or nil; - end)); + local message = st.message({ type = "chat", from = local_host }, + untrusted_fail_notification:gsub("%$([%w_]+)", function (v) + return event[v] or session and session[v] or replacements and replacements[v] or nil; + end)); for jid in untrusted_fail_watchers do module:log("debug", "Notifying %s", jid); message.attr.to = jid;