Mercurial > prosody-modules
changeset 927:a9dfa7232d88
Merge
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 12 Mar 2013 12:10:25 +0000 |
parents | f88381a39c56 (diff) 720b8268778e (current diff) |
children | 4584c3303bb4 |
files | mod_auth_ldap2/mod_auth_ldap.lua |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mod_block_subscribes/mod_block_subscribes.lua Tue Mar 12 12:10:25 2013 +0000 @@ -0,0 +1,13 @@ +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