Comparison

plugins/mod_pep.lua @ 1400:cbbb4f4fed68

mod_pep: Added some comments
author Waqas Hussain <waqas20@gmail.com>
date Wed, 24 Jun 2009 19:28:48 +0500
parent 1399:8879f8278762
child 1401:a3ce55c1e43a
comparison
equal deleted inserted replaced
1399:8879f8278762 1400:cbbb4f4fed68
67 end, 10); 67 end, 10);
68 68
69 module:add_iq_handler("c2s", "http://jabber.org/protocol/pubsub", function (session, stanza) 69 module:add_iq_handler("c2s", "http://jabber.org/protocol/pubsub", function (session, stanza)
70 if stanza.attr.type == 'set' and (not stanza.attr.to or jid_bare(stanza.attr.from) == stanza.attr.to) then 70 if stanza.attr.type == 'set' and (not stanza.attr.to or jid_bare(stanza.attr.from) == stanza.attr.to) then
71 local payload = stanza.tags[1]; 71 local payload = stanza.tags[1];
72 if payload.name == 'pubsub' then 72 if payload.name == 'pubsub' then -- <pubsub xmlns='http://jabber.org/protocol/pubsub'>
73 payload = payload.tags[1]; 73 payload = payload.tags[1];
74 if payload and payload.name == 'publish' and payload.attr.node then 74 if payload and payload.name == 'publish' and payload.attr.node then -- <publish node='http://jabber.org/protocol/tune'>
75 local node = payload.attr.node; 75 local node = payload.attr.node;
76 payload = payload.tags[1]; 76 payload = payload.tags[1];
77 if payload then 77 if payload then -- <item>
78 publish(session, node, payload); 78 publish(session, node, payload);
79 return true; 79 return true;
80 end -- TODO else error 80 end -- TODO else error
81 end -- TODO else error 81 end -- TODO else error
82 end 82 end