X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_privacy.lua;h=d5842e26c74d81509c7ef7308808ebe1786cbe68;hb=13c889639140f0b410750a836d00f6f1f0a9fe8c;hp=2f3b4863ac2cce8388db3d38d51fba987eb5795d;hpb=c5fc60c0f2a027ed639527a7c6c5ed309f86cd9c;p=prosody.git diff --git a/plugins/mod_privacy.lua b/plugins/mod_privacy.lua index 2f3b4863..d5842e26 100644 --- a/plugins/mod_privacy.lua +++ b/plugins/mod_privacy.lua @@ -7,6 +7,8 @@ -- COPYING file in the source package for more information. -- +module:add_feature("jabber:iq:privacy"); + local prosody = prosody; local st = require "util.stanza"; local datamanager = require "util.datamanager"; @@ -201,7 +203,7 @@ function getList(privacy_lists, origin, stanza, name) if name == nil then if privacy_lists.lists then - if origin.ActivePrivacyList then + if origin.activePrivacyList then reply:tag("active", {name=origin.activePrivacyList}):up(); end if privacy_lists.default then @@ -440,7 +442,9 @@ function preCheckOutgoing(e) e.stanza.attr.from = e.stanza.attr.from .. "/" .. session.resource; end end - return checkIfNeedToBeBlocked(e, session); + if session.username then -- FIXME do properly + return checkIfNeedToBeBlocked(e, session); + end end module:hook("pre-message/full", preCheckOutgoing, 500);