Mercurial > prosody-modules
comparison mod_admin_message/mod_admin_message.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 |
| parents | 9ed6d44b9fed |
| children |
comparison
equal
deleted
inserted
replaced
| 2886:5ca6d53d3186 | 2887:65082d91950e |
|---|---|
| 87 -- Strip trailing blank line | 87 -- Strip trailing blank line |
| 88 session.fulltext = tostring(session.fulltext):gsub("\n|%s*$", "") | 88 session.fulltext = tostring(session.fulltext):gsub("\n|%s*$", "") |
| 89 | 89 |
| 90 -- Send the reply stanza | 90 -- Send the reply stanza |
| 91 local reply_stanza = st.message({ from = host, to = userjid, | 91 local reply_stanza = st.message({ from = host, to = userjid, |
| 92 type = "chat" }); | 92 type = "chat" }, session.fulltext); |
| 93 reply_stanza = reply_stanza:body(session.fulltext); | |
| 94 module:send(reply_stanza); | 93 module:send(reply_stanza); |
| 95 | 94 |
| 96 return true; | 95 return true; |
| 97 end | 96 end |
| 98 | 97 |
