X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fpubsub.lua;h=e1418c62d51fdccf96b4f8605789ce0378e11a9e;hb=533fc1fa57ce10fc0821f8edaeb247f2710a543c;hp=e7fc86b10c23d706b1c6792bcb22eabd74ab3032;hpb=bf3ecf9003fca3f1cc218622ac5f385dd45aecb8;p=prosody.git diff --git a/util/pubsub.lua b/util/pubsub.lua index e7fc86b1..e1418c62 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -233,6 +233,9 @@ function service:delete(node, actor) end -- local node_obj = self.nodes[node]; + if not node_obj then + return false, "item-not-found"; + end self.nodes[node] = nil; self.config.broadcaster("delete", node, node_obj.subscribers); return true; @@ -350,7 +353,7 @@ function service:get_subscriptions(node, actor, jid) if node then -- Return only subscriptions to this node if subscribed_nodes[node] then ret[#ret+1] = { - node = subscribed_nodes[node]; + node = node; jid = jid; subscription = node_obj.subscribers[jid]; };