Bug 1083768 - IRC auth messages showing up on moznet. r=florian, a=florian
authorPatrick Cloke <clokep@gmail.com>
Thu, 16 Oct 2014 10:29:53 -0400
changeset 16903 df2b37118b36092ca71f3ac2ed17dd732750a725
parent 16902 2e711a9d6acfe44effda95c38274f431ceb11d57
child 16904 10f2002a35d85805a1ce4cb611e3a4978f1014f6
push id10509
push usernhnt11@gmail.com
push dateThu, 16 Oct 2014 14:30:36 +0000
treeherdercomm-central@df2b37118b36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, florian
bugs1083768
Bug 1083768 - IRC auth messages showing up on moznet. r=florian, a=florian
chat/protocols/irc/ircNonStandard.jsm
--- a/chat/protocols/irc/ircNonStandard.jsm
+++ b/chat/protocols/irc/ircNonStandard.jsm
@@ -27,18 +27,23 @@ var ircNonStandard = {
   commands: {
     "NOTICE": function(aMessage) {
       // NOTICE <msgtarget> <text>
 
       // 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.
-      let isAuth = aMessage.params[0] == "AUTH" &&
-                   aMessage.params[1].startsWith("***");
+      // 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 isAuth = target == "*" ||
+        (target == "auth" && (aMessage.nickname.toLowerCase() != "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});
         return true;