File

mod_block_subscriptions/mod_block_subscriptions.lua @ 4544:64fa2dd34d43

mod_prometheus: remove space between label k/v pairs It is illegal in OpenMetrics and not needed in the old prometheus format, so we better don't emit it.
author Jonas Schäfer <jonas@wielicki.name>
date Sun, 18 Apr 2021 13:42:07 +0200
parent 773:107eb83aa732
line wrap: on
line source

local allowed_presence_types = { probe = true, unavailable = true };

function filter_presence(event)
	local stanza = event.stanza;
	local presence_type = stanza.attr.type;
	if presence_type == nil or allowed_presence_types[presence_type] then
		return;
	end
	return true; -- Drop
end

module:hook("pre-presence/bare", filter_presence, 200); -- Client sending
module:hook("presence/bare", filter_presence, 200); -- Client receiving