X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_privacy.lua;h=d5842e26c74d81509c7ef7308808ebe1786cbe68;hb=6a6712b24e5f780549692190e0819e2d2622faa8;hp=10f44950a47151287e8eee57efca4a86fb497522;hpb=fc67a891781b47c31eda0c38f70fbd6908e77d26;p=prosody.git diff --git a/plugins/mod_privacy.lua b/plugins/mod_privacy.lua index 10f44950..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"; @@ -93,8 +95,10 @@ function activateList(privacy_lists, origin, stanza, which, name) elseif which == "active" and list then origin.activePrivacyList = name; origin.send(st.reply(stanza)); + elseif not list then + return {"cancel", "item-not-found", "No such list: "..name}; else - return {"modify", "bad-request", "Either not active or default given or unknown list name specified."}; + return {"modify", "bad-request", "No list chosen to be active or default."}; end return true; end @@ -199,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