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 25506 7a1c94333d8dcb88991fb09dd6ed5b4f66124913
parent 25505 97aaf40ebfdb379644ed61fee8ab6ddf0121c3de
child 25507 759077ce09b63b1d9fbd9ae59adb9dd81c72d563
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");
     },