Comparison

plugins/mod_pubsub.lua @ 3988:a3104064e905

mod_pubsub: Correctly wrap the list of subscriptions in a pubsub element
author Kim Alvefur <zash@zash.se>
date Wed, 29 Dec 2010 19:24:19 +0100
parent 3949:fc4ff6db1e57
child 4120:d62a2861f1f9
comparison
equal deleted inserted replaced
3987:8fbf57722368 3988:a3104064e905
72 local ok, ret = service:get_subscriptions(node, stanza.attr.from, stanza.attr.from); 72 local ok, ret = service:get_subscriptions(node, stanza.attr.from, stanza.attr.from);
73 if not ok then 73 if not ok then
74 return origin.send(pubsub_error_reply(stanza, ret)); 74 return origin.send(pubsub_error_reply(stanza, ret));
75 end 75 end
76 local reply = st.reply(stanza) 76 local reply = st.reply(stanza)
77 :tag("subscriptions", { xmlns = xmlns_pubsub }); 77 :tag("pubsub", { xmlns = xmlns_pubsub })
78 :tag("subscriptions");
78 for _, sub in ipairs(ret) do 79 for _, sub in ipairs(ret) do
79 reply:tag("subscription", { node = sub.node, jid = sub.jid, subscription = 'subscribed' }):up(); 80 reply:tag("subscription", { node = sub.node, jid = sub.jid, subscription = 'subscribed' }):up();
80 end 81 end
81 return origin.send(reply); 82 return origin.send(reply);
82 end 83 end