X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_conn_waitpong.cpp;h=1d48220a6b096330cbafecd9e077216149042f35;hb=2550d001423d25b50c7bfdc89f6efe81dbb64612;hp=764246e8476658b3d3228505b244da1d7539820e;hpb=fcacc8e0306382bc3f938073092c3729d77e2b41;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 764246e84..1d48220a6 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -35,26 +35,22 @@ class ModuleWaitPong : public Module public: ModuleWaitPong() : ext("waitpong_pingstr", this) + { + } + + void init() { ServerInstance->Modules->AddService(ext); OnRehash(NULL); Implementation eventlist[] = { I_OnUserRegister, I_OnCheckReady, I_OnPreCommand, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 4); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } void OnRehash(User* user) { - ConfigReader Conf; - - sendsnotice = Conf.ReadFlag("waitpong", "sendsnotice", 0); - - if(Conf.GetError() == CONF_VALUE_NOT_FOUND) - sendsnotice = true; - - killonbadreply = Conf.ReadFlag("waitpong", "killonbadreply", 0); - - if(Conf.GetError() == CONF_VALUE_NOT_FOUND) - killonbadreply = true; + ConfigTag* tag = ServerInstance->Config->ConfValue("waitpong"); + sendsnotice = tag->getBool("sendsnotice", true); + killonbadreply = tag->getBool("killonbadreply", true); } ModResult OnUserRegister(LocalUser* user)