mod_spam_reporting: Fire an event to ease processing from other modules
authorKim Alvefur <zash@zash.se>
Sat, 20 Aug 2016 17:15:50 +0200
changeset 2281 bad5dd466427
parent 2280 1b12ccbbd9b2
child 2282 983abc684851
mod_spam_reporting: Fire an event to ease processing from other modules
mod_spam_reporting/mod_spam_reporting.lua
--- a/mod_spam_reporting/mod_spam_reporting.lua	Sat Aug 20 17:15:14 2016 +0200
+++ b/mod_spam_reporting/mod_spam_reporting.lua	Sat Aug 20 17:15:50 2016 +0200
@@ -16,6 +16,9 @@
 				"unknown";
 			local reason = report:get_child_text("reason") or "no reason given";
 			module:log("warn", "Received report of %s from JID '%s', %s", type, jid, reason);
+			module:fire_event(module.name.."/"..type.."-report", {
+				origin = event.origin, stanza = event.stanza,
+				item = item, report = report, reason = reason, });
 		end
 	end
 end, 1);