Mercurial > prosody-modules
comparison mod_watch_spam_reports/mod_watch_spam_reports.lua @ 4046:d518f97dad6f
mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
author | Martin Dosch <martin@mdosch.de> |
---|---|
date | Tue, 16 Jun 2020 11:21:58 +0200 |
parents | |
children | 91e2e510e17c |
comparison
equal
deleted
inserted
replaced
4045:4fc6cf528a9a | 4046:d518f97dad6f |
---|---|
1 local st = require "util.stanza"; | |
2 local admins = module:get_option_inherited_set("admins"); | |
3 local host = module.host; | |
4 | |
5 module:depends("spam_reporting") | |
6 | |
7 module:hook("spam_reporting/spam-report", function(event) | |
8 for admin_jid in admins | |
9 do | |
10 module:send(st.message({from=host, | |
11 type="chat",to=admin_jid}, | |
12 event.stanza.attr.from.." reported "..event.jid.." as spammer: "..event.reason)); | |
13 end | |
14 end) |