Comparison

plugins/mod_pubsub/pubsub.lib.lua @ 10090:cdcf26331b9f

mod_pubsub: Eliminate dead code `data` is a stanza and always truthy
author Kim Alvefur <zash@zash.se>
date Thu, 25 Jul 2019 12:26:07 +0200
parent 10062:6ffed67356e9
child 10276:4e4ce7400b39
comparison
equal deleted inserted replaced
10089:90e459f48cbd 10090:cdcf26331b9f
326 326
327 local data = st.stanza("items", { node = node }); 327 local data = st.stanza("items", { node = node });
328 for _, id in ipairs(results) do 328 for _, id in ipairs(results) do
329 data:add_child(results[id]); 329 data:add_child(results[id]);
330 end 330 end
331 local reply; 331 local reply = st.reply(stanza)
332 if data then 332 :tag("pubsub", { xmlns = xmlns_pubsub })
333 reply = st.reply(stanza) 333 :add_child(data);
334 :tag("pubsub", { xmlns = xmlns_pubsub })
335 :add_child(data);
336 else
337 reply = pubsub_error_reply(stanza, "item-not-found");
338 end
339 origin.send(reply); 334 origin.send(reply);
340 return true; 335 return true;
341 end 336 end
342 337
343 function handlers.get_subscriptions(origin, stanza, subscriptions, service) 338 function handlers.get_subscriptions(origin, stanza, subscriptions, service)