Comparison

plugins/mod_pubsub.lua @ 5313:3d63f5236464

mod_pubsub: Fix nil access error.
author Waqas Hussain <waqas20@gmail.com>
date Sat, 26 Jan 2013 03:49:45 +0500
parent 5312:fdcd2ac7c22d
child 5314:e5e480d73066
comparison
equal deleted inserted replaced
5312:fdcd2ac7c22d 5313:3d63f5236464
316 if event.stanza.tags[1].attr.node then 316 if event.stanza.tags[1].attr.node then
317 return handle_disco_items_on_node(event); 317 return handle_disco_items_on_node(event);
318 end 318 end
319 local ok, ret = service:get_nodes(event.stanza.attr.from); 319 local ok, ret = service:get_nodes(event.stanza.attr.from);
320 if not ok then 320 if not ok then
321 event.origin.send(pubsub_error_reply(stanza, ret)); 321 event.origin.send(pubsub_error_reply(event.stanza, ret));
322 else 322 else
323 local reply = st.reply(event.stanza) 323 local reply = st.reply(event.stanza)
324 :tag("query", { xmlns = "http://jabber.org/protocol/disco#items" }); 324 :tag("query", { xmlns = "http://jabber.org/protocol/disco#items" });
325 for node, node_obj in pairs(ret) do 325 for node, node_obj in pairs(ret) do
326 reply:tag("item", { jid = module.host, node = node, name = node_obj.config.name }):up(); 326 reply:tag("item", { jid = module.host, node = node, name = node_obj.config.name }):up();