23 end |
23 end |
24 end |
24 end |
25 end |
25 end |
26 end); |
26 end); |
27 return true; |
27 return true; |
|
28 end |
|
29 |
|
30 function pubsub:create(server, node, callback) |
|
31 local create = verse.iq({ to = server, type = "set" }) |
|
32 :tag("pubsub", { xmlns = xmlns_pubsub }) |
|
33 :tag("create", { node = node }):up() |
|
34 self.stream:send_iq(create, function (result) |
|
35 if callback then |
|
36 if result.attr.type == "result" then |
|
37 callback(true); |
|
38 else |
|
39 callback(false, result:get_error()); |
|
40 end |
|
41 end |
|
42 end |
|
43 ); |
28 end |
44 end |
29 |
45 |
30 function pubsub:subscribe(server, node, jid, callback) |
46 function pubsub:subscribe(server, node, jid, callback) |
31 self.stream:send_iq(verse.iq({ to = server, type = "set" }) |
47 self.stream:send_iq(verse.iq({ to = server, type = "set" }) |
32 :tag("pubsub", { xmlns = xmlns_pubsub }) |
48 :tag("pubsub", { xmlns = xmlns_pubsub }) |