Mercurial > prosody-modules
comparison mod_spam_reporting/mod_spam_reporting.lua @ 2298:a59671b3dd43
mod_spam_reporting: Include jid in event
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 11 Sep 2016 00:09:52 +0200 |
| parents | bd1117002a9b |
| children | fe24bda72838 |
comparison
equal
deleted
inserted
replaced
| 2297:992e40dab31d | 2298:a59671b3dd43 |
|---|---|
| 20 report:get_child("abuse") and "abuse" or | 20 report:get_child("abuse") and "abuse" or |
| 21 "unknown"; | 21 "unknown"; |
| 22 local reason = report:get_child_text("text") or "no reason given"; | 22 local reason = report:get_child_text("text") or "no reason given"; |
| 23 module:log("warn", "Received report of %s from JID '%s', %s", type, jid, reason); | 23 module:log("warn", "Received report of %s from JID '%s', %s", type, jid, reason); |
| 24 module:fire_event(module.name.."/"..type.."-report", { | 24 module:fire_event(module.name.."/"..type.."-report", { |
| 25 origin = event.origin, stanza = event.stanza, | 25 origin = event.origin, stanza = event.stanza, jid = jid, |
| 26 item = item, report = report, reason = reason, }); | 26 item = item, report = report, reason = reason, }); |
| 27 end | 27 end |
| 28 end | 28 end |
| 29 end, 1); | 29 end, 1); |
