X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_gecosban.cpp;h=b33362a8df281f1905256df66f026b981bd5e0b7;hb=551d687ec6d7ce44be35fae0dd7345fe73c4f63a;hp=e7eca6d8fd20a7ac4a8f6561ef4fda7e8c7992e0;hpb=fcacc8e0306382bc3f938073092c3729d77e2b41;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp index e7eca6d8f..b33362a8d 100644 --- a/src/modules/m_gecosban.cpp +++ b/src/modules/m_gecosban.cpp @@ -24,14 +24,10 @@ class ModuleGecosBan : public Module { public: - ModuleGecosBan() + void init() { Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 2); - } - - ~ModuleGecosBan() - { + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } Version GetVersion() @@ -41,7 +37,7 @@ class ModuleGecosBan : public Module ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) { - if (mask[0] == 'r' && mask[1] == ':') + if ((mask.length() > 2) && (mask[0] == 'r') && (mask[1] == ':')) { if (InspIRCd::Match(user->fullname, mask.substr(2))) return MOD_RES_DENY; @@ -49,9 +45,9 @@ class ModuleGecosBan : public Module return MOD_RES_PASSTHRU; } - void On005Numeric(std::string &output) + void On005Numeric(std::map& tokens) { - ServerInstance->AddExtBanChar('r'); + tokens["EXTBAN"].push_back('r'); } };