plugins/pubsub.lua

changeset 395
e86144a4eaa1
parent 348
34b878d58948
child 437
2762abec4c63
equal deleted inserted replaced
394:c2e959b60c13 395:e86144a4eaa1
1 local verse = require "verse"; 1 local verse = require "verse";
2 local jid_bare = require "util.jid".bare;
3 2
4 local t_insert = table.insert; 3 local t_insert = table.insert;
5 4
6 local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; 5 local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
7 local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner"; 6 local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner";
8 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event"; 7 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
9 local xmlns_pubsub_errors = "http://jabber.org/protocol/pubsub#errors"; 8 -- local xmlns_pubsub_errors = "http://jabber.org/protocol/pubsub#errors";
10 9
11 local pubsub = {}; 10 local pubsub = {};
12 local pubsub_mt = { __index = pubsub }; 11 local pubsub_mt = { __index = pubsub };
13 12
14 function verse.plugins.pubsub(stream) 13 function verse.plugins.pubsub(stream)
211 function pubsub_node:subscribe(jid, options, callback) 210 function pubsub_node:subscribe(jid, options, callback)
212 jid = jid or self.stream.jid; 211 jid = jid or self.stream.jid;
213 if options ~= nil then 212 if options ~= nil then
214 error("Subscription configuration is not implemented yet."); 213 error("Subscription configuration is not implemented yet.");
215 end 214 end
216 self.stream:send_iq(pubsub_iq("set", self.service, nil, "subscribe", self.node, jid, id) 215 self.stream:send_iq(pubsub_iq("set", self.service, nil, "subscribe", self.node, jid)
217 , callback); 216 , callback);
218 end 217 end
219 218
220 function pubsub_node:subscription(callback) 219 function pubsub_node:subscription(callback)
221 error("Not implemented yet."); 220 error("Not implemented yet.");

mercurial