X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_deaf.cpp;h=a315a89f11ac13d45cbe230ecec781f5311ca8d6;hb=e9e75e50bc25e67af22dd88b39b12217a553d5cb;hp=0a002bd07716633e2ae84b3dbef2324d79cfafa4;hpb=46a39046196f55b52336e19662bb7bac85b731ac;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp index 0a002bd07..a315a89f1 100644 --- a/src/modules/m_deaf.cpp +++ b/src/modules/m_deaf.cpp @@ -21,7 +21,7 @@ #include "inspircd.h" -/* $ModDesc: Provides support for ircu style usermode +d (deaf to channel messages and channel notices) */ +/* $ModDesc: Provides usermode +d to block channel messages and channel notices */ /** User mode +d - filter out channel messages and channel notices */ @@ -56,7 +56,6 @@ class User_d : public ModeHandler class ModuleDeaf : public Module { User_d m1; - std::string deaf_bypasschars; std::string deaf_bypasschars_uline; @@ -64,20 +63,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) @@ -157,15 +158,10 @@ class ModuleDeaf : public Module } } - virtual ~ModuleDeaf() - { - } - virtual Version GetVersion() { - return Version("Provides support for ircu style usermode +d (deaf to channel messages and channel notices)", VF_VENDOR); + return Version("Provides usermode +d to block channel messages and channel notices", VF_VENDOR); } - }; MODULE_INIT(ModuleDeaf)