File

mod_uptime_presence/mod_uptime_presence.lua @ 4610:342664061c9b

mod_http_upload: Fix issuing slots to components or other non-c2s sessions The 'full_jid' property only exists on local c2s sessions. This was not adjusted for in 0a56dc6c61af, so it did not work. Thanks Fren__ for highlighting the issue.
author Kim Alvefur <zash@zash.se>
date Thu, 01 Jul 2021 16:17:35 +0200
parent 917:d3497b81a3b5
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);