Bug 1078223 - Errors handling IRC WATCH messages 598 and 599 on moznet. r=clokep,a=Standard8
authoraleth <aleth@instantbird.org>
Sat, 18 Oct 2014 21:40:10 +0200
changeset 25555 1995aa350f35ee5f247a49ebb1870e1b45d1b38a
parent 25554 1238fbdc3cc899860b641c61e4ae93dda0faf7f8
child 25556 c286aae15d961bcd2f91dd4134489fbd57844761
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersclokep, Standard8
bugs1078223
Bug 1078223 - Errors handling IRC WATCH messages 598 and 599 on moznet. r=clokep,a=Standard8
chat/protocols/irc/ircWatchMonitor.jsm
--- a/chat/protocols/irc/ircWatchMonitor.jsm
+++ b/chat/protocols/irc/ircWatchMonitor.jsm
@@ -190,22 +190,26 @@ var ircWATCH = {
 
     "597": function(aMessage) { // RPL_REAWAY
       // <nickname> <username> <hostname> <awaysince> :<away reason>
       return setStatus(this, aMessage.params[1], "AWAY");
     },
 
     "598": function(aMessage) { // RPL_GONEAWAY
       // <nickname> <username> <hostname> <awaysince> :<away reason>
-      return setStatus(this, aMessage.params[1], "AWAY");
+      // We use a negative index as inspircd versions < 2.0.18 don't send
+      // the user's nick as the first parameter (see bug 1078223).
+      return setStatus(this, aMessage.params[aMessage.params.length - 5], "AWAY");
     },
 
     "599": function(aMessage) { // RPL_NOTAWAY
       // <nickname> <username> <hostname> <awaysince> :is no longer away
-      return setStatus(this, aMessage.params[1], "AVAILABLE");
+      // We use a negative index as inspircd versions < 2.0.18 don't send
+      // the user's nick as the first parameter (see bug 1078223).
+      return setStatus(this, aMessage.params[aMessage.params.length - 5], "AVAILABLE");
     },
 
     "600": function(aMessage) { // RPL_LOGON
       // <nickname> <username> <hostname> <signontime> :logged on
       return setStatus(this, aMessage.params[1], "AVAILABLE");
     },
 
     "601": function(aMessage) { // RPL_LOGOFF
@@ -220,17 +224,17 @@ var ircWATCH = {
 
     "603": function(aMessage) { // RPL_WATCHSTAT
       // You have <entrycount> and are on <onlistcount> WATCH entries
       // TODO I don't think we really need to care about this.
       return false;
     },
 
     "604": function(aMessage) { // RPL_NOWON
-      // <<nickname> <username> <hostname> <lastnickchange> :is online
+      // <nickname> <username> <hostname> <lastnickchange> :is online
       return setStatus(this, aMessage.params[1], "AVAILABLE");
     },
 
     "605": function(aMessage) { // RPL_NOWOFF
       // <nickname> <username> <hostname> <lastnickchange> :is offline
       return setStatus(this, aMessage.params[1], "OFFLINE");
     },