summaryrefslogtreecommitdiff
path: root/src/modules/m_override.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-19 02:28:30 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2010-01-19 02:28:30 +0000
commit0429d86a7afa7d5c1e27e48f27db0687d2688d87 (patch)
treeb25b6bfbc41f67156a7a5b4d9b4cca34e3a9f26d /src/modules/m_override.cpp
parent066cad22e48e111de9a993c9ebaddb275b773a75 (diff)
Clean up some slow iterations
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12300 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_override.cpp')
-rw-r--r--src/modules/m_override.cpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index 982f65853..3131ab4b2 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -15,11 +15,8 @@
/* $ModDesc: Provides support for unreal-style oper-override */
-typedef std::map<std::string,std::string> override_t;
-
class ModuleOverride : public Module
{
- override_t overrides;
bool RequireKey;
bool NoisyOverride;
@@ -42,15 +39,6 @@ class ModuleOverride : public Module
// re-read our config options on a rehash
NoisyOverride = Conf.ReadFlag("override", "noisy", 0);
RequireKey = Conf.ReadFlag("override", "requirekey", 0);
-
- overrides.clear();
-
- for (int j =0; j < Conf.Enumerate("type"); j++)
- {
- std::string typen = Conf.ReadValue("type","name",j);
- std::string tokenlist = Conf.ReadValue("type","override",j);
- overrides[typen] = tokenlist;
- }
}
void On005Numeric(std::string &output)
@@ -60,17 +48,10 @@ class ModuleOverride : public Module
bool CanOverride(User* source, const char* token)
{
- // checks to see if the oper's type has <type:override>
- override_t::iterator j = overrides.find(source->oper->name);
-
- if (j != overrides.end())
- {
- // its defined or * is set, return its value as a boolean for if the token is set
- return ((j->second.find(token, 0) != std::string::npos) || (j->second.find("*", 0) != std::string::npos));
- }
+ std::string tokenlist = source->oper->getConfig("override");
- // its not defined at all, count as false
- return false;
+ // its defined or * is set, return its value as a boolean for if the token is set
+ return ((tokenlist.find(token, 0) != std::string::npos) || (tokenlist.find("*", 0) != std::string::npos));
}