diff stanzas.js @ 13:161d4ea1c3f8

Migration of the client-side to XMPP.js instead of Strophe.js. Drop BOSH support and add WebSockets support. The server-side is untested, may be broken.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 03 Nov 2011 14:23:10 -0700
parents
children
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/stanzas.js
@@ -0,0 +1,20 @@
+var stanzas = {
+	discoInfo: function(aTo, aNode) {
+		if(aTo)
+			var iq = "<iq type='get' to='"+aTo+"'>";
+		else
+			var iq = "<iq type='get'>";
+		if(aNode)
+			var query = "<query xmlns='"+ns.info+"' node='"+aNode+"'/>";
+		else
+			var query = "<query xmlns='"+ns.info+"'/>";
+			
+		return iq+query+"</iq>";
+	},
+	pubsubItems: function(aTo, aNode) {
+		return  "<iq type='get' to='"+aTo+"'><pubsub xmlns='"+ns.ps+"'><items node='"+aNode+"'/></pubsub></iq>";
+	},
+};
+
+if (typeof module !== 'undefined')
+	module.exports = stanzas;