view mod_watch_spam_reports/mod_watch_spam_reports.lua @ 4047:36b6e3e3f9e2

mod_conversejs: Disable automatic BOSH/WS endpoint discovery Converse.js 7.0 will enable this by default, but when using this module the BOSH and WebSocket endpoints are provided in the generated HTML, so automatic discovery is not needed and unlikely to work without an additional module.
author Kim Alvefur <zash@zash.se>
date Thu, 18 Jun 2020 15:24:34 +0200
parents d518f97dad6f
children 91e2e510e17c
line wrap: on
line source

local st = require "util.stanza";
local admins = module:get_option_inherited_set("admins");
local host = module.host;

module:depends("spam_reporting")

module:hook("spam_reporting/spam-report", function(event)
	for admin_jid in admins
		do
			module:send(st.message({from=host,
			type="chat",to=admin_jid},
			event.stanza.attr.from.." reported "..event.jid.." as spammer: "..event.reason));
		end
end)