X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_gecosban.cpp;h=c7194aef56ba06c56987d05b5443237646ba0c09;hb=27cef863f7286b626e01f1287f31005478a66fea;hp=3c041c548154b5e4b2edb7a52b1bee93bd20bdfb;hpb=4676743fac7383346b7768e7a98f25e16b68826f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_gecosban.cpp b/src/modules/m_gecosban.cpp index 3c041c548..c7194aef5 100644 --- a/src/modules/m_gecosban.cpp +++ b/src/modules/m_gecosban.cpp @@ -15,17 +15,17 @@ /* $ModDesc: Implements extban +b r: - realname (gecos) bans */ -class ModuleNickBan : public Module +class ModuleGecosBan : public Module { private: public: - ModuleNickBan(InspIRCd* Me) : Module(Me) + ModuleGecosBan(InspIRCd* Me) : Module(Me) { Implementation eventlist[] = { I_OnUserPreJoin, I_On005Numeric }; ServerInstance->Modules->Attach(eventlist, this, 2); } - virtual ~ModuleNickBan() + virtual ~ModuleGecosBan() { } @@ -42,12 +42,9 @@ class ModuleNickBan : public Module if (!c) return 0; - ServerInstance->Logs->Log("EXTBANS", DEBUG, "Checking if %s is banned", user->fullname.c_str()); - if (c->IsExtBanned(user->fullname, 'r')) { - // XXX: send a numeric here - user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Cannot join " + c->name + ", as you match a ban"); + user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Cannot join channel (You're banned)", user->nick.c_str(), c->name.c_str()); return 1; } @@ -56,13 +53,10 @@ class ModuleNickBan : public Module virtual void On005Numeric(std::string &output) { - if (output.find(" EXTBAN=:") == std::string::npos) - output.append(" EXTBAN=:r"); - else - output.insert(output.find(" EXTBAN=:") + 9, "r"); + ServerInstance->AddExtBanChar('r'); } }; -MODULE_INIT(ModuleNickBan) +MODULE_INIT(ModuleGecosBan)