# HG changeset patch # User Kim Alvefur # Date 1471706114 -7200 # Node ID 1b12ccbbd9b20034b81ace2b3ef4e12a53fe9785 # Parent 7f228bf82fe581c45c8c3647f884bf79521c3c72 mod_spam_reporting: Continue looking for spam reports even when one does not have one diff -r 7f228bf82fe5 -r 1b12ccbbd9b2 mod_spam_reporting/mod_spam_reporting.lua --- a/mod_spam_reporting/mod_spam_reporting.lua Sat Aug 20 17:13:43 2016 +0200 +++ b/mod_spam_reporting/mod_spam_reporting.lua Sat Aug 20 17:15:14 2016 +0200 @@ -10,11 +10,12 @@ for item in event.stanza.tags[1]:childtags("item") do local report = item:get_child("report", "urn:xmpp:reporting:0"); local jid = item.attr.jid; - if not report or not jid then return end - local type = report:get_child("spam") and "spam" or - report:get_child("abuse") and "abuse" or - "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); + if report and jid then + local type = report:get_child("spam") and "spam" or + report:get_child("abuse") and "abuse" or + "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); + end end end, 1);