plugins/mod_pubsub.lua

changeset 3988
a3104064e905
parent 3949
fc4ff6db1e57
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

mercurial