aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-11-01 17:59:46 +0100
committerKim Alvefur <zash@zash.se>2021-11-01 17:59:46 +0100
commitaf11afa9c6f3766068d2aa369a7f4c15cbbf1d9a (patch)
treed0cf47d951d51e5a33a166e9686013e00f779dc8
parentff2e0641b9e2f0d251c59ca9f80d72f07f4dc7ec (diff)
downloadprosody-af11afa9c6f3766068d2aa369a7f4c15cbbf1d9a.tar.gz
prosody-af11afa9c6f3766068d2aa369a7f4c15cbbf1d9a.zip
mod_pubsub: Return proper errors for disco queries on nodes
Previously this would return item-not-found, even when you could see the node in disco#items.
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 71900416..3e29bc10 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -280,7 +280,8 @@ function _M.handle_disco_info_node(event, service)
local ok, ret = service:get_nodes(stanza.attr.from);
local node_obj = ret[node];
if not ok or not node_obj then
- return;
+ event.origin.send(pubsub_error_reply(stanza, ret or "item-not-found"));
+ return true;
end
event.exists = true;
reply:tag("identity", { category = "pubsub", type = "leaf" }):up();
@@ -299,7 +300,8 @@ function _M.handle_disco_items_node(event, service)
local stanza, reply, node = event.stanza, event.reply, event.node;
local ok, ret = service:get_items(node, stanza.attr.from);
if not ok then
- return;
+ event.origin.send(pubsub_error_reply(stanza, ret));
+ return true;
end
for _, id in ipairs(ret) do