]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sqloper.cpp
Remove the intercomm system since sqlite is synchronous.
[user/henk/code/inspircd.git] / src / modules / m_sqloper.cpp
index c4eaa6911000cc14187b490b2e2d3caa6a514e32..a6da1ddaafa7b30069f8921355bdfbe46841df16 100644 (file)
@@ -275,26 +275,21 @@ public:
 
        bool OperUser(User* user, const std::string &pattern, const std::string &type)
        {
-               ConfigReader Conf;
-
-               for (int j = 0; j < Conf.Enumerate("type"); j++)
-               {
-                       std::string tname = Conf.ReadValue("type","name",j);
-                       std::string hostname(user->ident);
+               OperIndex::iterator iter = ServerInstance->Config->oper_blocks.find(" " + type);
+               if (iter == ServerInstance->Config->oper_blocks.end())
+                       return false;
+               OperInfo* ifo = iter->second;
 
-                       hostname.append("@").append(user->host);
+               std::string hostname(user->ident);
 
-                       if ((tname == type) && OneOfMatches(hostname.c_str(), user->GetIPString(), pattern.c_str()))
-                       {
-                               /* Opertype and host match, looks like this is it. */
-                               std::string operhost = Conf.ReadValue("type", "host", j);
+               hostname.append("@").append(user->host);
 
-                               if (operhost.size())
-                                       user->ChangeDisplayedHost(operhost.c_str());
+               if (OneOfMatches(hostname.c_str(), user->GetIPString(), pattern.c_str()))
+               {
+                       /* Opertype and host match, looks like this is it. */
 
-                               user->Oper(type, tname);
-                               return true;
-                       }
+                       user->Oper(ifo);
+                       return true;
                }
 
                return false;