Bug 842024 - Thunderbird Chat can't connect to EuIRC, r=fqueze.
authorPatrick Cloke <clokep@gmail.com>
Sun, 17 Feb 2013 13:34:42 -0500
changeset 14915 dad38b5c00990a76b470c67b27b02344cb826b94
parent 14914 87e8a0c36afe25bbd63c49fff8787b1b8f5f7015
child 14916 478a56a58bfffd319fe6202afd9acdd78eb04e8b
push id867
push userbugzilla@standard8.plus.com
push dateMon, 01 Apr 2013 20:44:27 +0000
treeherdercomm-beta@797726b8d244 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfqueze
bugs842024
Bug 842024 - Thunderbird Chat can't connect to EuIRC, r=fqueze.
chat/modules/socket.jsm
chat/protocols/irc/irc.js
--- a/chat/modules/socket.jsm
+++ b/chat/modules/socket.jsm
@@ -221,32 +221,31 @@ const Socket = {
   },
 
   // Send data on the output stream. Provide aLoggedData to log something
   // different than what is actually sent.
   sendData: function(/* string */ aData, aLoggedData) {
     this.LOG("Sending:\n" + (aLoggedData || aData));
 
     try {
-      this._outputStream.write(aData + this.delimiter,
-                               aData.length + this.delimiter.length);
+      this._outputStream.write(aData, aData.length);
     } catch(e) {
       Cu.reportError(e);
     }
   },
 
   // Send a string to the output stream after converting the encoding. Provide
   // aLoggedData to log something different than what is actually sent.
   sendString: function(aString, aEncoding, aLoggedData) {
     this.LOG("Sending:\n" + (aLoggedData || aString));
 
     let converter = new ScriptableUnicodeConverter();
     converter.charset = aEncoding || "UTF-8";
     try {
-      let stream = converter.convertToInputStream(aString + this.delimiter);
+      let stream = converter.convertToInputStream(aString);
       this._outputStream.writeFrom(stream, stream.available());
     } catch(e) {
       Cu.reportError(e);
     }
   },
 
   sendBinaryData: function(/* ArrayBuffer */ aData) {
     this.LOG("Sending binary data data: <" + aData + ">");
--- a/chat/protocols/irc/irc.js
+++ b/chat/protocols/irc/irc.js
@@ -1316,16 +1316,18 @@ ircAccount.prototype = {
 
     let length = this.countBytes(aMessage) + 2;
     if (length > this.maxMessageLength) {
       // Log if the message is too long, but try to send it anyway.
       this.WARN("Message length too long (" + length + " > " +
                 this.maxMessageLength + "\n" + aMessage);
     }
 
+    aMessage += "\r\n";
+
     try {
       this._socket.sendString(aMessage, this._encoding, aLoggedData);
     } catch (e) {
       try {
         this.WARN("Failed to convert " + aMessage + " from Unicode to " +
                   this._encoding + ".");
         this._socket.sendData(aMessage, aLoggedData);
       } catch(e) {