diff options
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r-- | util/pubsub.lua | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua index acb34db9..11ed4e1c 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -1,6 +1,5 @@ -local events = require "util.events"; -local cache = require "util.cache"; -local errors = require "util.error"; +local events = require "prosody.util.events"; +local cache = require "prosody.util.cache"; local service_mt = {}; @@ -263,7 +262,7 @@ function service:get_default_affiliation(node, actor) --> affiliation if self.config.access_models then local check = self.config.access_models[access_model]; if check then - local aff = check(actor); + local aff = check(actor, node_obj); if aff then return aff; end @@ -562,11 +561,7 @@ function service:publish(node, actor, id, item, requested_config) --> ok, err -- Check that node has the requested config before we publish local ok, field = check_preconditions(node_obj.config, requested_config); if not ok then - local err = errors.new({ - type = "cancel", condition = "conflict", text = "Field does not match: "..field; - }); - err.pubsub_condition = "precondition-not-met"; - return false, err; + return false, "precondition-not-met", { field = field }; end end if not self.config.itemcheck(item) then |