Bug 1083768 - IRC auth messages showing up on moznet, fix error. r=nhnt11, a=florian
authorPatrick Cloke <clokep@gmail.com>
Thu, 16 Oct 2014 12:27:40 -0400
changeset 16904 10f2002a35d85805a1ce4cb611e3a4978f1014f6
parent 16903 df2b37118b36092ca71f3ac2ed17dd732750a725
child 16905 ee088ecb23da1c352d6c08b85655002b8de251a8
push id10510
push usernhnt11@gmail.com
push dateThu, 16 Oct 2014 16:28:26 +0000
treeherdercomm-central@10f2002a35d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnhnt11, florian
bugs1083768
Bug 1083768 - IRC auth messages showing up on moznet, fix error. r=nhnt11, a=florian
chat/protocols/irc/ircNonStandard.jsm
--- a/chat/protocols/irc/ircNonStandard.jsm
+++ b/chat/protocols/irc/ircNonStandard.jsm
@@ -31,18 +31,19 @@ var ircNonStandard = {
       // Try to avoid the stupid case where the user's nick is AUTH. If this
       // happens, it is ambiguous if it is an AUTH message or a NOTICE to the
       // user. Generally AUTH messages start with ***, but this could pretty
       // easily be faked.
       // Freenode simply sends * for the target. Moznet sends Auth (used to send
       // AUTH); in this case, check if the user's nickname is not auth, or the
       // the message starts with ***.
       let target = aMessage.params[0].toLowerCase();
+      let nickname = aMessage.nickname ? aMessage.nickname.toLowerCase() : "";
       let isAuth = target == "*" ||
-        (target == "auth" && (aMessage.nickname.toLowerCase() != "auth" ||
+        (target == "auth" && (nickname != "auth" ||
                               aMessage.params[1].startsWith("***")));
 
       // Some servers , e.g. irc.umich.edu, use NOTICE before connection to give
       // directions to users.
       if (!this.connected && !isAuth) {
         this.getConversation(aMessage.servername)
             .writeMessage(aMessage.servername, aMessage.params[1],
                           {incoming: true});