view mod_block_subscribes/mod_block_subscribes.lua @ 1216:81a3bf8aba90

mod_component_client: Use the net.server connection abstraction for sending whitespace keep-alive, and not the raw socket (fixes a traceback which lead to an infinite timer loop in libevent)
author Waqas Hussain <waqas20@gmail.com>
date Mon, 28 Oct 2013 11:55:59 -0400
parents f88381a39c56
children
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