plugins/pubsub2room.lua

changeset 104
8202cdfb99b4
parent 99
072509afc701
child 138
7c95aba75a55
equal deleted inserted replaced
103:c0235605d6d5 104:8202cdfb99b4
70 -- FIXME When to unsubscribe? 70 -- FIXME When to unsubscribe?
71 bot:hook("started", function() 71 bot:hook("started", function()
72 local jid = bare_jid(bot.stream.jid); 72 local jid = bare_jid(bot.stream.jid);
73 for hostnode in pairs(config) do 73 for hostnode in pairs(config) do
74 local host, node = hostnode:match("^([^#]+)#(.*)"); 74 local host, node = hostnode:match("^([^#]+)#(.*)");
75 bot.stream.pubsub(host, node):subscribe(jid, print); 75 bot.stream.pubsub(host, node):subscribe(jid);
76 end 76 end
77 end); 77 end);
78 end 78 end

mercurial