265 reason = "urn:xmpp:reporting:spam"; |
265 reason = "urn:xmpp:reporting:spam"; |
266 elseif reason == "abuse" or not reason or reason = "" then |
266 elseif reason == "abuse" or not reason or reason = "" then |
267 reason = "urn:xmpp:reporting:abuse"; |
267 reason = "urn:xmpp:reporting:abuse"; |
268 end |
268 end |
269 local code = [[ |
269 local code = [[ |
270 local newstanza = st.stanza("message", { to = %q, from = current_host }):tag("forwarded", { xmlns = "urn:xmpp:forward:0" }); |
270 local newstanza = st.stanza("message", { to = %q, from = current_host, id = new_short_id() }):tag("forwarded", { xmlns = "urn:xmpp:forward:0" }); |
271 local tmp_stanza = st.clone(stanza); tmp_stanza.attr.xmlns = "jabber:client"; newstanza:add_child(tmp_stanza):up(); |
271 local tmp_stanza = st.clone(stanza); tmp_stanza.attr.xmlns = "jabber:client"; newstanza:add_child(tmp_stanza):up(); |
272 newstanza:tag("report", { xmlns = "urn:xmpp:reporting:1", reason = %q }) |
272 newstanza:tag("report", { xmlns = "urn:xmpp:reporting:1", reason = %q }) |
273 do local text = %q; if text ~= "" then newstanza:text_tag("text", text); end end |
273 do local text = %q; if text ~= "" then newstanza:text_tag("text", text); end end |
274 newstanza:up(); |
274 newstanza:up(); |
275 core_post_stanza(session, newstanza); |
275 core_post_stanza(session, newstanza); |
276 ]]; |
276 ]]; |
277 return code:format(where, reason, text), { "core_post_stanza", "current_host", "st" }; |
277 return code:format(where, reason, text), { "core_post_stanza", "current_host", "st", "new_short_id" }; |
278 end |
278 end |
279 |
279 |
280 return action_handlers; |
280 return action_handlers; |