Comparison

plugins/mod_pep.lua @ 3290:1eec2bd19bf7

mod_pep: Fixed a possible traceback during disco#items queries on a user's bare JID by remote users.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 24 Jun 2010 03:29:39 +0500
parent 3132:4d2251242ac1
child 3344:b16f842b7525
comparison
equal deleted inserted replaced
3289:180a0b3b018d 3290:1eec2bd19bf7
287 stanza:tag('identity', {category='pubsub', type='pep'}):up(); 287 stanza:tag('identity', {category='pubsub', type='pep'}):up();
288 stanza:tag('feature', {var='http://jabber.org/protocol/pubsub#publish'}):up(); 288 stanza:tag('feature', {var='http://jabber.org/protocol/pubsub#publish'}):up();
289 end); 289 end);
290 290
291 module:hook("account-disco-items", function(event) 291 module:hook("account-disco-items", function(event)
292 local session, stanza = event.session, event.stanza; 292 local stanza = event.stanza;
293 local bare = session.username..'@'..session.host; 293 local bare = stanza.attr.to;
294 local user_data = data[bare]; 294 local user_data = data[bare];
295 295
296 if user_data then 296 if user_data then
297 for node, _ in pairs(user_data) do 297 for node, _ in pairs(user_data) do
298 stanza:tag('item', {jid=bare, node=node}):up(); -- TODO we need to handle queries to these nodes 298 stanza:tag('item', {jid=bare, node=node}):up(); -- TODO we need to handle queries to these nodes