diff options
Diffstat (limited to 'src/modules/m_override.cpp')
-rw-r--r-- | src/modules/m_override.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index ce9ea17e2..346d38b9f 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -35,6 +35,20 @@ class ModuleOverride : public Module ChanModeReference key; ChanModeReference limit; + static bool IsOverride(unsigned int userlevel, const std::string& modeline) + { + for (std::string::const_iterator i = modeline.begin(); i != modeline.end(); ++i) + { + ModeHandler* mh = ServerInstance->Modes->FindMode(*i, MODETYPE_CHANNEL); + if (!mh) + continue; + + if (mh->GetLevelRequired() > userlevel) + return true; + } + return false; + } + public: ModuleOverride() : topiclock(this, "topiclock") @@ -110,7 +124,10 @@ class ModuleOverride : public Module unsigned int mode = channel->GetPrefixValue(source); - if (mode < HALFOP_VALUE && CanOverride(source, "MODE")) + if (!IsOverride(mode, parameters[1])) + return MOD_RES_PASSTHRU; + + if (CanOverride(source, "MODE")) { std::string msg = source->nick+" overriding modes:"; for(unsigned int i=0; i < parameters.size(); i++) |