X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_operjoin.cpp;h=2f5dda0ff4a55425d690c028ac979e5a26a3091a;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=af787b815980ab35a454472cadc331accbe7b03a;hpb=46a39046196f55b52336e19662bb7bac85b731ac;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp index af787b815..2f5dda0ff 100644 --- a/src/modules/m_operjoin.cpp +++ b/src/modules/m_operjoin.cpp @@ -28,7 +28,6 @@ class ModuleOperjoin : public Module { - private: std::string operChan; std::vector operChans; bool override; @@ -53,29 +52,25 @@ class ModuleOperjoin : public Module } public: - ModuleOperjoin() + void init() { OnRehash(NULL); Implementation eventlist[] = { I_OnPostOper, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } virtual void OnRehash(User* user) { - ConfigReader conf; + ConfigTag* tag = ServerInstance->Config->ConfValue("operjoin"); - operChan = conf.ReadValue("operjoin", "channel", 0); - override = conf.ReadFlag("operjoin", "override", "0", 0); + operChan = tag->getString("channel"); + override = tag->getBool("override", false); operChans.clear(); if (!operChan.empty()) tokenize(operChan,operChans); } - virtual ~ModuleOperjoin() - { - } - virtual Version GetVersion() { return Version("Forces opers to join the specified channel(s) on oper-up", VF_VENDOR); @@ -90,7 +85,7 @@ class ModuleOperjoin : public Module if (ServerInstance->IsChannel(it->c_str(), ServerInstance->Config->Limits.ChanMax)) Channel::JoinUser(user, it->c_str(), override, "", false, ServerInstance->Time()); - std::string chanList = IS_OPER(user)->getConfig("autojoin"); + std::string chanList = user->oper->getConfig("autojoin"); if (!chanList.empty()) { std::vector typechans;