Bug 955537 - Ensure that commands that only work in channels use CONTEXT_CHAT, r=aleth.
authorPatrick Cloke <clokep@gmail.com>
Sat, 19 Oct 2013 19:03:23 -0400
changeset 17313 43618a31ce1b6bff61678f97f9e1227bb1c4d4f7
parent 17312 03a1d87c844ec29708d1a2340283beba06a75997
child 17314 aecef621e18ac9ea1b72778ffa4f970f8bb23082
push id1151
push userbugzilla@standard8.plus.com
push dateMon, 03 Feb 2014 22:50:32 +0000
treeherdercomm-aurora@267d8e9143d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleth
bugs955537
Bug 955537 - Ensure that commands that only work in channels use CONTEXT_CHAT, r=aleth.
chat/protocols/irc/ircCommands.jsm
--- a/chat/protocols/irc/ircCommands.jsm
+++ b/chat/protocols/irc/ircCommands.jsm
@@ -132,21 +132,23 @@ var commands = [
   {
     name: "chanserv",
     get helpString() _("command.chanserv", "chanserv"),
     run: function(aMsg, aConv) privateMessage(aConv, aMsg, "ChanServ")
   },
   {
     name: "deop",
     get helpString() _("command.deop", "deop"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: function(aMsg, aConv) setMode(aMsg, aConv, "o", false)
   },
   {
     name: "devoice",
     get helpString() _("command.devoice", "devoice"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: function(aMsg, aConv) setMode(aMsg, aConv, "v", false)
   },
   {
     name: "invite",
     get helpString() _("command.invite2", "invite"),
     run: function(aMsg, aConv) {
       let params = splitInput(aMsg);
 
@@ -202,16 +204,17 @@ var commands = [
           account.joinChat(account.getChatRoomDefaultFieldValues(joinParam));
       });
       return true;
     }
   },
   {
     name: "kick",
     get helpString() _("command.kick", "kick"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: kickCommand
   },
   {
     name: "list",
     get helpString() _("command.list", "list"),
     run: function(aMsg, aConv) {
       let account = getAccount(aConv);
       let serverName = account._currentServerName;
@@ -313,26 +316,28 @@ var commands = [
   {
     name: "notice",
     get helpString() _("command.notice", "notice"),
     run: function(aMsg, aConv) simpleCommand(aConv, "NOTICE", aMsg)
   },
   {
     name: "op",
     get helpString() _("command.op", "op"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: function(aMsg, aConv) setMode(aMsg, aConv, "o", true)
   },
   {
     name: "operserv",
     get helpString() _("command.operserv", "operserv"),
     run: function(aMsg, aConv) privateMessage(aConv, aMsg, "OperServ")
   },
   {
     name: "part",
     get helpString() _("command.part", "part"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: function (aMsg, aConv) {
       getConv(aConv).part(aMsg);
       return true;
     }
   },
   {
     name: "ping",
     get helpString() _("command.ping", "ping"),
@@ -375,26 +380,28 @@ var commands = [
 
       getAccount(aConv).sendRawMessage(aMsg);
       return true;
     }
   },
   {
     name: "remove",
     get helpString() _("command.kick", "remove"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: kickCommand
   },
   {
     name: "time",
     get helpString() _("command.time", "time"),
     run: function(aMsg, aConv) simpleCommand(aConv, "TIME")
   },
   {
     name: "topic",
     get helpString() _("command.topic", "topic"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: function(aMsg, aConv) {
       aConv.topic = aMsg;
       return true;
     }
   },
   {
     name: "umode",
     get helpString() _("command.umode", "umode"),
@@ -408,16 +415,17 @@ var commands = [
         return false;
       ctcpCommand(aConv, aMsg, "VERSION");
       return true;
     }
   },
   {
     name: "voice",
     get helpString() _("command.voice", "voice"),
+    usageContext: Ci.imICommand.CMD_CONTEXT_CHAT,
     run: function(aMsg, aConv) setMode(aMsg, aConv, "v", true)
   },
   {
     name: "whois",
     get helpString() _("command.whois2", "whois"),
     run: function(aMsg, aConv) {
       // Note that this will automatically run whowas if the nick is offline.
       aMsg = aMsg.trim();