comparison mod_spam_reporting/mod_spam_reporting.lua @ 2277:bad5dd466427

mod_spam_reporting: Fire an event to ease processing from other modules
author Kim Alvefur <zash@zash.se>
date Sat, 20 Aug 2016 17:15:50 +0200
parents 1b12ccbbd9b2
children ccca1c8927c3
comparison
equal deleted inserted replaced
2276:1b12ccbbd9b2 2277:bad5dd466427
14 local type = report:get_child("spam") and "spam" or 14 local type = report:get_child("spam") and "spam" or
15 report:get_child("abuse") and "abuse" or 15 report:get_child("abuse") and "abuse" or
16 "unknown"; 16 "unknown";
17 local reason = report:get_child_text("reason") or "no reason given"; 17 local reason = report:get_child_text("reason") or "no reason given";
18 module:log("warn", "Received report of %s from JID '%s', %s", type, jid, reason); 18 module:log("warn", "Received report of %s from JID '%s', %s", type, jid, reason);
19 module:fire_event(module.name.."/"..type.."-report", {
20 origin = event.origin, stanza = event.stanza,
21 item = item, report = report, reason = reason, });
19 end 22 end
20 end 23 end
21 end, 1); 24 end, 1);