annotate mod_watch_spam_reports/mod_watch_spam_reports.lua @ 4048:64b7daa6c42c

mod_csi_battery_saver: Ignore CSI actions before resource bind
author tmolitor <thilo@eightysoft.de>
date Mon, 22 Jun 2020 21:35:57 +0200
parents d518f97dad6f
children 91e2e510e17c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4046
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
1 local st = require "util.stanza";
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
2 local admins = module:get_option_inherited_set("admins");
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
3 local host = module.host;
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
4
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
5 module:depends("spam_reporting")
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
6
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
7 module:hook("spam_reporting/spam-report", function(event)
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
8 for admin_jid in admins
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
9 do
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
10 module:send(st.message({from=host,
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
11 type="chat",to=admin_jid},
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
12 event.stanza.attr.from.." reported "..event.jid.." as spammer: "..event.reason));
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
13 end
d518f97dad6f mod_watch_spam_reports: Module to notify admins about incoming XEP-0377 spam reports
Martin Dosch <martin@mdosch.de>
parents:
diff changeset
14 end)