X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_deaf.cpp;h=43b24cfae9c6dba39b0f6ce6b0a64c40164c792b;hb=a785f350fd584d87f3b84bbaff569ecb59c29f04;hp=3e0d205bae2fa8347f42ee8759a1b24c8ae46c65;hpb=74ee9af96639323d852a8b15be72ee9974e0a826;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp index 3e0d205ba..43b24cfae 100644 --- a/src/modules/m_deaf.cpp +++ b/src/modules/m_deaf.cpp @@ -64,20 +64,22 @@ class ModuleDeaf : public Module ModuleDeaf() : m1(this) { - if (!ServerInstance->Modes->AddMode(&m1)) - throw ModuleException("Could not add new modes!"); + } + + void init() + { + ServerInstance->Modules->AddService(m1); OnRehash(NULL); Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, 3); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - virtual void OnRehash(User* user) { - ConfigReader conf; - deaf_bypasschars = conf.ReadValue("deaf", "bypasschars", 0); - deaf_bypasschars_uline = conf.ReadValue("deaf", "bypasscharsuline", 0); + ConfigTag* tag = ServerInstance->Config->ConfValue("deaf"); + deaf_bypasschars = tag->getString("bypasschars"); + deaf_bypasschars_uline = tag->getString("bypasscharsuline"); } virtual ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)