Comparison

mod_alias/mod_alias.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 1953:0c3ba5ff7a3b
comparison
equal deleted inserted replaced
2886:5ca6d53d3186 2887:65082d91950e
24 target = target 24 target = target
25 }; 25 };
26 local error_message = alias_response:gsub("%$([%w_]+)", function (v) 26 local error_message = alias_response:gsub("%$([%w_]+)", function (v)
27 return replacements[v] or nil; 27 return replacements[v] or nil;
28 end); 28 end);
29 local message = st.message{ type = "chat", from = alias, to = event.stanza.attr.from }:tag("body"):text(error_message); 29 local message = st.message({ type = "chat", from = alias, to = event.stanza.attr.from }, error_message);
30 module:send(message); 30 module:send(message);
31 return event.origin.send(st.error_reply(event.stanza, "cancel", "gone", error_message)); 31 return event.origin.send(st.error_reply(event.stanza, "cancel", "gone", error_message));
32 end 32 end
33 end 33 end
34 34