Software /
code /
prosody
Diff
util/pubsub.lua @ 11723:3ead0967e04d
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 22 Jul 2021 19:53:21 +0200 |
parent | 11721:7a77f0c05382 |
child | 11767:5610f7c5b261 |
line wrap: on
line diff
--- a/util/pubsub.lua Wed Jul 21 23:02:25 2021 +0200 +++ b/util/pubsub.lua Thu Jul 22 19:53:21 2021 +0200 @@ -652,13 +652,14 @@ 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);