summaryrefslogtreecommitdiff
path: root/modules/commands/cs_mode.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-08-28 15:46:15 -0400
committerAdam <Adam@anope.org>2011-09-10 02:05:00 -0400
commit700a585b1bb38a9dc0ac3e749083250d405488f8 (patch)
tree8af306bd60778815fe5a137590d3b888213ad231 /modules/commands/cs_mode.cpp
parent62752db4c49a8679b51d5996003fd3a23c2a3f2d (diff)
Allow modules to add their own channel levels
Diffstat (limited to 'modules/commands/cs_mode.cpp')
-rw-r--r--modules/commands/cs_mode.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index 3e4ed784c..a36e68690 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -20,13 +20,13 @@ class CommandCSMode : public Command
if (!u || !ci || !cm || cm->Type != MODE_STATUS)
return false;
- const ChannelAccess accesses[] = { CA_VOICE, CA_HALFOP, CA_OPDEOP, CA_PROTECT, CA_OWNER, CA_SIZE };
+ const Anope::string accesses[] = { "VOICE", "HALFOP", "OPDEOP", "PROTECT", "OWNER", "" };
const ChannelModeName modes[] = { CMODE_VOICE, CMODE_HALFOP, CMODE_OP, CMODE_PROTECT, CMODE_OWNER };
ChannelModeStatus *cms = debug_cast<ChannelModeStatus *>(cm);
AccessGroup access = ci->AccessFor(u);
unsigned short u_level = 0;
- for (int i = 0; accesses[i] != CA_SIZE; ++i)
+ for (int i = 0; !accesses[i].empty(); ++i)
if (access.HasPriv(accesses[i]))
{
ChannelMode *cm2 = ModeManager::FindChannelModeByName(modes[i]);
@@ -319,7 +319,7 @@ class CommandCSMode : public Command
if (!ci || !ci->c)
source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str());
- else if (!ci->AccessFor(u).HasPriv(CA_MODE) && !u->HasCommand("chanserv/mode"))
+ else if (!ci->AccessFor(u).HasPriv("MODE") && !u->HasCommand("chanserv/mode"))
source.Reply(ACCESS_DENIED);
else if (subcommand.equals_ci("LOCK"))
this->DoLock(source, ci, params);