From cff87b44fba973f96032ab5931d1a3838c1036b3 Mon Sep 17 00:00:00 2001 From: "silver%warwickcompsoc.co.uk" Date: Tue, 9 Jun 2009 14:10:04 +0000 Subject: [PATCH] Bug 486979 - Don't let half-ops think they can grant/revoke half-op status on others. ChatZilla only. p=glenjamin+bmo@gmail.com (Glen Mailer) r=silver git-svn-id: svn://10.0.0.236/trunk@257443 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/irc/xul/content/menus.js | 22 +++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/mozilla/extensions/irc/xul/content/menus.js b/mozilla/extensions/irc/xul/content/menus.js index 12ecd329372..8685fe6b500 100644 --- a/mozilla/extensions/irc/xul/content/menus.js +++ b/mozilla/extensions/irc/xul/content/menus.js @@ -309,23 +309,25 @@ function initMenus() }; // Me is op. - var isop = "(cx.channel.iAmOp()) && "; + var isop = "(cx.channel.iAmOp()) && "; // Me is op or half-op. - var isopish = "(cx.channel.iAmOp() || cx.channel.iAmHalfOp()) && "; + var isopish = "(cx.channel.iAmOp() || cx.channel.iAmHalfOp()) && "; // Server has half-ops. - var shop = "(cx.server.supports.prefix.indexOf('h') > 0) && "; - + var shop = "(cx.server.supports.prefix.indexOf('h') > 0) && "; + // User is Me or Me is op. + var isoporme = "((cx.user == cx.server.me) || cx.channel.iAmOp()) && "; + client.menuSpecs["popup:opcommands"] = { label: MSG_MNU_OPCOMMANDS, accesskey: getAccessKeyForMenu('MSG_MNU_OPCOMMANDS'), items: [ - ["op", {visibleif: isop + "!cx.user.isOp"}], - ["deop", {visibleif: isop + "cx.user.isOp"}], - ["hop", {visibleif: isopish + shop + "!cx.user.isHalfOp"}], - ["dehop", {visibleif: isopish + shop + "cx.user.isHalfOp"}], - ["voice", {visibleif: isopish + "!cx.user.isVoice"}], - ["devoice", {visibleif: isopish + "cx.user.isVoice"}], + ["op", {visibleif: isop + "!cx.user.isOp"}], + ["deop", {visibleif: isop + "cx.user.isOp"}], + ["hop", {visibleif: isop + "!cx.user.isHalfOp"}], + ["dehop", {visibleif: isoporme + "cx.user.isHalfOp"}], + ["voice", {visibleif: isopish + "!cx.user.isVoice"}], + ["devoice", {visibleif: isopish + "cx.user.isVoice"}], ["-"], ["ban", {enabledif: "(" + isop + "1) || (" + isopish + "!cx.user.isOp)"}], ["unban", {enabledif: "(" + isop + "1) || (" + isopish + "!cx.user.isOp)"}],