X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_gecosban.cpp;h=49dd117a16fe7cef508966b8c421cbe15715c94d;hb=24623a5fe6ff986ad342e2b00d3576b4899a6033;hp=e7eca6d8fd20a7ac4a8f6561ef4fda7e8c7992e0;hpb=46a39046196f55b52336e19662bb7bac85b731ac;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp index e7eca6d8f..49dd117a1 100644 --- a/src/modules/m_gecosban.cpp +++ b/src/modules/m_gecosban.cpp @@ -19,29 +19,23 @@ #include "inspircd.h" -/* $ModDesc: Implements extban +b r: - realname (gecos) bans */ - class ModuleGecosBan : public Module { public: - ModuleGecosBan() + void init() CXX11_OVERRIDE { Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric }; - ServerInstance->Modules->Attach(eventlist, this, 2); - } - - ~ModuleGecosBan() - { + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Extban 'r' - realname (gecos) ban", VF_OPTCOMMON|VF_VENDOR); } - ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) + ModResult OnCheckBan(User *user, Channel *c, const std::string& mask) CXX11_OVERRIDE { - 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 +43,9 @@ class ModuleGecosBan : public Module return MOD_RES_PASSTHRU; } - void On005Numeric(std::string &output) + void On005Numeric(std::map& tokens) CXX11_OVERRIDE { - ServerInstance->AddExtBanChar('r'); + tokens["EXTBAN"].push_back('r'); } };