Software /
code /
prosody-modules
Diff
mod_sms_clickatell/mod_sms_clickatell.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 | 2874:178b8abf8283 |
child | 3353:e8d6f602f382 |
line wrap: on
line diff
--- a/mod_sms_clickatell/mod_sms_clickatell.lua Tue Feb 20 17:30:17 2018 +0100 +++ b/mod_sms_clickatell/mod_sms_clickatell.lua Sat Feb 17 08:42:10 2018 +0100 @@ -150,7 +150,7 @@ function dmsg(jid, msg) module:log("debug", msg or "nil"); if jid ~= nil then - send_stanza(st.message({to=jid, from=component_host, type='chat'}):tag("body"):text(msg or "nil"):up()); + send_stanza(st.message({to=jid, from=component_host, type='chat'}, msg or "nil")); end end @@ -498,7 +498,7 @@ -- Now parse the message if stanza.attr.to == component_host then -- Messages directly to the component jget echoed - origin.send(st.message({to=stanza.attr.from, from=component_host, type='chat'}):tag("body"):text(msg.body):up()); + origin.send(st.message({to=stanza.attr.from, from=component_host, type='chat'}, msg.body)); elseif users[from_bjid].data.roster[to.node] ~= nil then -- If message contains a body, send message to SMS Test User if msg.body ~= nil then