annotate plugins/pubsub.js @ 54:0b7dd59e264a

Fix Connection.load and add the init method to plugins.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 01 Feb 2012 04:08:15 +0100
parents d1a7895b3dce
children d1ba6f0e2a92
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96898e3812a5 initial push
Sonny Piers <sonny.piers@gmail.com>
parents:
diff changeset
1 'use strict';
96898e3812a5 initial push
Sonny Piers <sonny.piers@gmail.com>
parents:
diff changeset
2
2
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
3 /**
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
4 Copyright (c) 2011, Sonny Piers <sonny at fastmail dot net>
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
5
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
6 Permission to use, copy, modify, and/or distribute this software for any
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
7 purpose with or without fee is hereby granted, provided that the above
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
8 copyright notice and this permission notice appear in all copies.
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
9
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
17 */
f31a75c3b6c8 code cleaning
Sonny Piers <sonny.piers@gmail.com>
parents: 0
diff changeset
18
7
715726598b23 improvements on plugins
Sonny Piers <sonny.piers@gmail.com>
parents: 3
diff changeset
19 //////////
715726598b23 improvements on plugins
Sonny Piers <sonny.piers@gmail.com>
parents: 3
diff changeset
20 //PubSub//
715726598b23 improvements on plugins
Sonny Piers <sonny.piers@gmail.com>
parents: 3
diff changeset
21 //////////
53
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
22 Lightstring.plugins['pubsub'] = {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
23 namespaces: {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
24 x: "jabber:x:data", //XXX
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
25 pubsub: "http://jabber.org/protocol/pubsub",
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
26 pubsub_owner: "http://jabber.org/protocol/pubsub#owner",
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
27 pubsub_error: "http://jabber.org/protocol/pubsub#error"
20
7fcccf59e6ec Always use two-spaces indent.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 16
diff changeset
28 },
53
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
29 stanzas: {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
30 getConfig: function(aTo, aNode) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
31 return "<iq type='get' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub_owner + "'><configure node='" + aNode + "'/></pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
32 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
33 items: function(aTo, aNode) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
34 return "<iq type='get' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub + "'><items node='" + aNode + "'/></pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
35 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
36 affiliations: function(aTo, aNode) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
37 return "<iq type='get' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub_owner + "'><affiliations node='" + aNode + "'/></pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
38 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
39 publish: function(aTo, aNode, aItem, aId) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
40 return "<iq type='set' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub + "'><publish node='" + aNode + "'><item id='" + aId + "'>" + aItem + "</item></publish></pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
41 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
42 retract: function(aTo, aNode, aItem) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
43 return "<iq type='set' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub + "'><retract node='" + aNode + "'><item id='" + aItem + "'/></retract></pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
44 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
45 'delete': function(aTo, aNode, aURI) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
46 return "<iq type='set' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub_owner + "'><delete node='" + aNode + "'/></pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
47 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
48 create: function(aTo, aNode, aFields) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
49 var iq = "<iq type='set' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub + "'><create node='" + aNode + "'/>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
50 if (aFields) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
51 iq += "<configure><x xmlns='" + Lightstring.NS.x + "' type='submit'>"
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
52 aFields.forEach(function(field) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
53 iq += field;
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
54 });
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
55 iq += "</x></configure>";
20
7fcccf59e6ec Always use two-spaces indent.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 16
diff changeset
56 }
53
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
57 iq += "</pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
58 return iq;
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
59 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
60 setAffiliations: function(aTo, aNode, aAffiliations) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
61 var iq = "<iq type='set' to='" + aTo + "'><pubsub xmlns='" + Lightstring.NS.pubsub_owner + "'><affiliations node='" + aNode + "'>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
62 for (var i = 0; i < aAffiliations.length; i++)
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
63 iq += "<affiliation jid='" + aAffiliations[i][0] + "' affiliation='" + aAffiliations[i][1] + "'/>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
64 iq += "</affiliations></pubsub></iq>";
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
65 return iq;
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
66 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
67 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
68 methods: {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
69 items: function(aTo, aNode, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
70 this.send(Lightstring.stanza.pubsub.items(aTo, aNode), function(stanza) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
71 var items = [];
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
72 var elms = stanza.DOM.querySelectorAll('item');
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
73 for (var i = 0; i < elms.length; i++) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
74 var node = elms[i];
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
75 var item = {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
76 id: node.getAttribute('id'),
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
77 name: node.querySelector('title').textContent,
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
78 src: node.querySelector('content').getAttribute('src'),
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
79 type: node.querySelector('content').getAttribute('type'),
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
80 }
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
81 var miniature = node.querySelector('link');
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
82 if (miniature)
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
83 item.miniature = miniature.getAttribute('href');
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
84 items.push(item);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
85 };
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
86
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
87 if (aResult)
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
88 aResult(items);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
89 }, aError);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
90 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
91 create: function(aTo, aNode, aFields, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
92 this.send(Lightstring.stanza.pubsub.create(aTo, aNode, aFields), aResult, aError);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
93 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
94 config: function(aTo, aNode, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
95 this.send(Lightstring.stanza.pubsub.getConfig(aTo, aNode), function(stanza) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
96 //FIXME: wtf?
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
97 var accessmodel = stanza.DOM.querySelector('field[var="pubsub#access_model"]').lastChild.textContent;
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
98 if(accessmodel)
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
99 aResult, aError(accessmodel);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
100 else
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
101 aResult, aError(null);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
102 });
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
103 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
104 retract: function(aTo, aNode, aItem, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
105 this.send(Lightstring.stanza.pubsub.retract(aTo, aNode, aItem), aResult, aError);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
106 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
107 publish = function(aTo, aNode, aItem, aId, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
108 this.send(Lightstring.stanza.pubsub.publish(aTo, aNode, aItem, aId), aResult, aError);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
109 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
110 'delete': function(aTo, aNode, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
111 this.send(Lightstring.stanza.pubsub.delete(aTo, aNode), aResult, aError);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
112 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
113 getAffiliations: function(aTo, aNode, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
114 this.send(Lightstring.stanza.pubsub.affiliations(aTo, aNode), function(stanza) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
115 if((stanza.DOM.getAttribute('type') === 'result') && aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
116 var affiliations = {};
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
117 stanza.DOM.querySelectorAll('affiliation').forEach(function(affiliation) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
118 affiliations[affiliation.getAttribute("jid")] = affiliation.getAttribute("affiliation");
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
119 })
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
120 if (aResult)
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
121 aResult(affiliations);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
122 }
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
123 }, aError);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
124 },
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
125 setAffiliations: function(aTo, aNode, aAffiliations, aResult, aError) {
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
126 this.send(Lightstring.stanza.pubsub.setAffiliations(aTo, aNode, aAffiliations), aResult, aError);
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
127 }
d1a7895b3dce Fix PubSub plugin.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 35
diff changeset
128 }
0
96898e3812a5 initial push
Sonny Piers <sonny.piers@gmail.com>
parents:
diff changeset
129 };