Mercurial > eldonilo > blog
annotate stanzas.js @ 15:5149a856d9dd default tip
Fix hybrid mode.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Thu, 03 Nov 2011 17:28:49 -0700 |
parents | 161d4ea1c3f8 |
children |
rev | line source |
---|---|
13
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
1 var stanzas = { |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
2 discoInfo: function(aTo, aNode) { |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
3 if(aTo) |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
4 var iq = "<iq type='get' to='"+aTo+"'>"; |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
5 else |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
6 var iq = "<iq type='get'>"; |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
7 if(aNode) |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
8 var query = "<query xmlns='"+ns.info+"' node='"+aNode+"'/>"; |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
9 else |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
10 var query = "<query xmlns='"+ns.info+"'/>"; |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
11 |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
12 return iq+query+"</iq>"; |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
13 }, |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
14 pubsubItems: function(aTo, aNode) { |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
15 return "<iq type='get' to='"+aTo+"'><pubsub xmlns='"+ns.ps+"'><items node='"+aNode+"'/></pubsub></iq>"; |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
16 }, |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
17 }; |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
18 |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
19 if (typeof module !== 'undefined') |
161d4ea1c3f8
Migration of the client-side to XMPP.js instead of Strophe.js.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
diff
changeset
|
20 module.exports = stanzas; |