view mod_uptime_presence/mod_uptime_presence.lua @ 5116:85882735fd33

mod_http_muc_log: make default presence visibility configurable This helps with reducing noise in some public places, such as the XSF MUC logs. As requested by emus.
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 17 Dec 2022 13:27:56 +0100
parents d3497b81a3b5
children
line wrap: on
line source

local st = require"util.stanza";
local datetime = require"util.datetime";

local presence = st.presence({ from = module.host })
	:tag("delay", { xmlns = "urn:xmpp:delay",
		stamp = datetime.datetime(prosody.start_time) });

module:hook("presence/host", function(event)
	local stanza = event.stanza;
	if stanza.attr.type == "probe" then
		presence.attr.id = stanza.attr.id;
		presence.attr.to = stanza.attr.from;
		module:send(presence);
		return true;
	end
end, 10);