# HG changeset patch # User Kim Alvefur # Date 1635785986 -3600 # Node ID c3bd71227e17cf90695e1194674df1a4cb33c1f2 # Parent 2138fc13d53a6ad237f1543c23e3d949fdf928ca 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. diff -r 2138fc13d53a -r c3bd71227e17 plugins/mod_pubsub/pubsub.lib.lua --- a/plugins/mod_pubsub/pubsub.lib.lua Thu Oct 28 13:02:59 2021 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Mon Nov 01 17:59:46 2021 +0100 @@ -280,7 +280,8 @@ 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 @@ 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