X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_hidechans.cpp;h=008c622086efc8caf14147480de27d4ef194b5df;hb=2550d001423d25b50c7bfdc89f6efe81dbb64612;hp=9c582551b7dfcab396a3611110d70aed3e4c5484;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp index 9c582551b..008c62208 100644 --- a/src/modules/m_hidechans.cpp +++ b/src/modules/m_hidechans.cpp @@ -37,10 +37,13 @@ class ModuleHideChans : public Module public: ModuleHideChans() : hm(this) { - if (!ServerInstance->Modes->AddMode(&hm)) - throw ModuleException("Could not add new modes!"); + } + + void init() + { + ServerInstance->Modules->AddService(hm); Implementation eventlist[] = { I_OnWhoisLine, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); } @@ -55,8 +58,7 @@ class ModuleHideChans : public Module virtual void OnRehash(User* user) { - ConfigReader conf; - AffectsOpers = conf.ReadFlag("hidechans", "affectsopers", 0); + AffectsOpers = ServerInstance->Config->ConfValue("hidechans")->getBool("affectsopers"); } ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text)