# HG changeset patch # User Sonny Piers # Date 1333640203 -7200 # Node ID b211a00efa7f170e346bb0bf163bb20d6eb1644c # Parent c5240333ea4cdf3267df2c89acbfb6c1fe2e7834 Various implementation improvements. diff --git a/lightstring.js b/lightstring.js --- a/lightstring.js +++ b/lightstring.js @@ -33,11 +33,10 @@ var Lightstring = { stanzas: { stream: { open: function(aService) { - //WORKAROUND: no ending "/" - node-xmpp-bosh bug return ""; + " version='1.0'>"; }, close: function() { return ""; @@ -156,7 +155,7 @@ Lightstring.Connection.prototype = { this.socket = new WebSocket(this.service, 'xmpp'); // Safari else if (typeof(WebSocket) === 'object') - this.socket = new WebSocket(this.service); + this.socket = new WebSocket(this.service, 'xmpp'); // Old Gecko else if (typeof(MozWebSocket) === 'function') { this.socket = new MozWebSocket(this.service, 'xmpp'); @@ -173,7 +172,6 @@ Lightstring.Connection.prototype = { //return; //TODO: error var stream = Lightstring.stanzas.stream.open(Conn.jid.domain); - //FIXME: Use Lightstring.Connection.send (problem with parsing steam); this.send(stream); var stanza = { XML: stream @@ -299,7 +297,7 @@ Lightstring.Connection.prototype = { disconnect: function() { this.emit('disconnecting'); var stream = Lightstring.stanzas.stream.close(); - this.send(stream); + this.socket.send(stream); this.emit('XMLOutput', stream); this.socket.close(); },