mod_block_subscriptions/mod_block_subscriptions.lua
author Kim Alvefur <zash@zash.se>
Fri, 24 Aug 2018 16:28:48 +0200
changeset 3262 85e3117b2b60
parent 773 107eb83aa732
permissions -rw-r--r--
mod_pubsub_github/README: Note that it might work with Gitlab as well Guess based on looking at this documentation: https://developer.github.com/v3/activity/events/types/#pushevent https://docs.gitlab.com/ee/system_hooks/system_hooks.html#push-events

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