# HG changeset patch # User Martin Dosch # Date 1625166003 -7200 # Node ID 7a9e1c81c63e0e9d2bdee3bca6cf3f25dabdfdf3 # Parent 342664061c9b8a9267a7e67cfa40e978caed0f24 mod_watch_spam_reports: Support spam_reporting/abuse-report Now it also notifies for spam_reporting/abuse-report, before it only did for spam_reporting/spam-report diff -r 342664061c9b -r 7a9e1c81c63e mod_watch_spam_reports/mod_watch_spam_reports.lua --- a/mod_watch_spam_reports/mod_watch_spam_reports.lua Thu Jul 01 16:17:35 2021 +0200 +++ b/mod_watch_spam_reports/mod_watch_spam_reports.lua Thu Jul 01 21:00:03 2021 +0200 @@ -7,7 +7,7 @@ module:hook("spam_reporting/spam-report", function(event) local reporter_bare_jid = jid.bare(event.stanza.attr.from) - local report = reporter_bare_jid.." reported "..event.jid.." as spammer: "..event.reason + local report = reporter_bare_jid.." reported spam from "..event.jid..": "..event.reason for admin_jid in admins do module:send(st.message({from=host, @@ -15,3 +15,14 @@ report)); end end) + +module:hook("spam_reporting/abuse-report", function(event) + local reporter_bare_jid = jid.bare(event.stanza.attr.from) + local report = reporter_bare_jid.." reported abuse from "..event.jid..": "..event.reason + for admin_jid in admins + do + module:send(st.message({from=host, + type="chat",to=admin_jid}, + report)); + end +end)