comparison plugins/mod_pep.lua @ 6054:7a5ddbaf758d

Merge 0.9->0.10
author Matthew Wild <mwild1@gmail.com>
date Wed, 02 Apr 2014 17:41:38 +0100
parents 11b6157ee274
children 2f709bc35575
comparison
equal deleted inserted replaced
6053:2f93a04564b2 6054:7a5ddbaf758d
1 -- Prosody IM 1 -- Prosody IM
2 -- Copyright (C) 2008-2010 Matthew Wild 2 -- Copyright (C) 2008-2010 Matthew Wild
3 -- Copyright (C) 2008-2010 Waqas Hussain 3 -- Copyright (C) 2008-2010 Waqas Hussain
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 9
261 end 261 end
262 end 262 end
263 end); 263 end);
264 264
265 module:hook("account-disco-info", function(event) 265 module:hook("account-disco-info", function(event)
266 local stanza = event.stanza; 266 local reply = event.reply;
267 stanza:tag('identity', {category='pubsub', type='pep'}):up(); 267 reply:tag('identity', {category='pubsub', type='pep'}):up();
268 stanza:tag('feature', {var='http://jabber.org/protocol/pubsub#publish'}):up(); 268 reply:tag('feature', {var='http://jabber.org/protocol/pubsub#publish'}):up();
269 end); 269 end);
270 270
271 module:hook("account-disco-items", function(event) 271 module:hook("account-disco-items", function(event)
272 local stanza = event.stanza; 272 local reply = event.reply;
273 local bare = stanza.attr.to; 273 local bare = reply.attr.to;
274 local user_data = data[bare]; 274 local user_data = data[bare];
275 275
276 if user_data then 276 if user_data then
277 for node, _ in pairs(user_data) do 277 for node, _ in pairs(user_data) do
278 stanza:tag('item', {jid=bare, node=node}):up(); -- TODO we need to handle queries to these nodes 278 reply:tag('item', {jid=bare, node=node}):up(); -- TODO we need to handle queries to these nodes
279 end 279 end
280 end 280 end
281 end); 281 end);