diff options
author | Kim Alvefur <zash@zash.se> | 2021-07-22 19:53:21 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2021-07-22 19:53:21 +0200 |
commit | dfed446a5adcb06b2e3af2181e57d17384cbbfaa (patch) | |
tree | f0ece126972003eb0bc7b4e96890fe345a8dd383 /util/pubsub.lua | |
parent | 1603e003b144d3ee98d30444665161ebb658cf3f (diff) | |
download | prosody-dfed446a5adcb06b2e3af2181e57d17384cbbfaa.tar.gz prosody-dfed446a5adcb06b2e3af2181e57d17384cbbfaa.zip |
util.pubsub: Signal that 'persistent-items' is unsupported when disabled
XEP-0060 says that this the way to indicate that 'persistent-items' is
unsupported, but doesn't explicitly say if it being disabled in the node
configuration also counts as unsupported.
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r-- | util/pubsub.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util/pubsub.lua b/util/pubsub.lua index 4b16dcfc..ae1d6353 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -652,13 +652,14 @@ function service:get_items(node, actor, ids) --> (true, { id, [id] = node }) or if not node_obj then return false, "item-not-found"; end + if not self.data[node] then + -- Disabled rather than unsupported, but close enough. + return false, "persistent-items-unsupported"; + end if type(ids) == "string" then -- COMPAT see #1305 ids = { ids }; end local data = {}; - if not self.data[node] then - return true, data; - end if ids then for _, key in ipairs(ids) do local value = self.data[node]:get(key); |