diff options
author | Adam <Adam@anope.org> | 2013-04-08 00:19:07 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-04-08 00:19:07 -0500 |
commit | 1a37e1c0480f8bd11f57dfba514069a4e9c7d8de (patch) | |
tree | 41798df9056ef555f00c4a6c0964f1219c357dc3 /modules/commands/cs_mode.cpp | |
parent | fb7fef7a849342ab8463743497e781c5c3e6ae88 (diff) |
Made auto* chanserv privileges not hard coded.
Made cs_statusupdate not remove status on users if they still match other entries.
Move privilege descriptions out of the config
Diffstat (limited to 'modules/commands/cs_mode.cpp')
-rw-r--r-- | modules/commands/cs_mode.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 1d0f0985b..f0f7894cf 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -20,25 +20,7 @@ class CommandCSMode : public Command if (!ci || !cm || cm->type != MODE_STATUS) return false; - const Anope::string accesses[] = { "VOICE", "HALFOP", "OPDEOP", "PROTECT", "OWNER", "" }, - accesses_self[] = { "VOICEME", "HALFOPME", "OPDEOPME", "PROTECTME", "OWNERME", "" }; - const Anope::string modes[] = { "VOICE", "HALFOP", "OP", "PROTECT", "OWNER" }; - ChannelModeStatus *cms = anope_dynamic_static_cast<ChannelModeStatus *>(cm); - AccessGroup access = source.AccessFor(ci); - short u_level = -1; - - for (int i = 0; !accesses[i].empty(); ++i) - if (access.HasPriv(self ? accesses_self[i] : accesses[i])) - { - ChannelMode *cm2 = ModeManager::FindChannelModeByName(modes[i]); - if (cm2 == NULL || cm2->type != MODE_STATUS) - continue; - ChannelModeStatus *cms2 = anope_dynamic_static_cast<ChannelModeStatus *>(cm2); - if (cms2->level > u_level) - u_level = cms2->level; - } - - return u_level >= cms->level; + return source.AccessFor(ci).HasPriv(cm->name + (self ? "ME" : "")); } void DoLock(CommandSource &source, ChannelInfo *ci, const std::vector<Anope::string> ¶ms) |