summaryrefslogtreecommitdiff
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-03 17:12:36 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-11-03 17:12:36 +0000
commit17cc3b8490692ee3a225f052425deb43a45b98db (patch)
tree124959537dd3607d49302fb78f43a8da188e1fc3 /src/configreader.cpp
parent80df092fa38524a415a3bb258384dde819ec86e3 (diff)
Create m_halfop
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11997 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 9e0aa2031..348554584 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -30,7 +30,6 @@
#include "xline.h"
#include "exitcodes.h"
#include "commands/cmd_whowas.h"
-#include "modes/cmode_h.h"
#include "configparser.h"
ServerConfig::ServerConfig()
@@ -749,9 +748,6 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
ServerInstance->Exit(EXIT_STATUS_CONFIG);
}
- if (ConfValue("options")->getBool("allowhalfop"))
- ServerInstance->Modes->AddMode(new ModeChannelHalfOp);
-
return;
}
@@ -768,18 +764,6 @@ void ServerConfig::Apply(ServerConfig* old, const std::string &useruid)
void ServerConfig::ApplyModules(User* user)
{
- bool AllowHalfOp = ConfValue("options")->getBool("allowhalfop");
- ModeHandler* mh = ServerInstance->Modes->FindMode('h', MODETYPE_CHANNEL);
- if (AllowHalfOp && !mh) {
- ServerInstance->Logs->Log("CONFIG", DEFAULT, "Enabling halfop mode.");
- mh = new ModeChannelHalfOp;
- ServerInstance->Modes->AddMode(mh);
- } else if (!AllowHalfOp && mh) {
- ServerInstance->Logs->Log("CONFIG", DEFAULT, "Disabling halfop mode.");
- ServerInstance->Modes->DelMode(mh);
- delete mh;
- }
-
Module* whowas = ServerInstance->Modules->Find("cmd_whowas.so");
if (whowas)
WhowasRequest(NULL, whowas, WhowasRequest::WHOWAS_PRUNE).Send();
@@ -802,6 +786,9 @@ void ServerConfig::ApplyModules(User* user)
}
}
+ if (ConfValue("options")->getBool("allowhalfop") && removed_modules.erase("m_halfop.so") == 0)
+ added_modules.push_back("m_halfop.so");
+
for (std::set<std::string>::iterator removing = removed_modules.begin(); removing != removed_modules.end(); removing++)
{
// Don't remove cmd_*.so, just remove m_*.so