X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cban.cpp;h=d1fb23620b1d2b2ca01ef1c85f76d7a04158224c;hb=33180223e318c304892b3fa8640f90f1ddf6f4b4;hp=7235a8befa3d186aca0d82882b7bddf8121d003b;hpb=124c17e14134a4999afc1a5e981ab7c75b3694b9;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 7235a8bef..d1fb23620 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -24,6 +24,12 @@ #include "xline.h" #include "modules/stats.h" +enum +{ + // InspIRCd-specific. + ERR_BADCHANNEL = 926 +}; + /** Holds a CBAN item */ class CBan : public XLine @@ -85,7 +91,7 @@ class CommandCBan : public Command flags_needed = 'o'; this->syntax = " [ :]"; } - CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE + CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* syntax: CBAN #channel time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ @@ -132,7 +138,7 @@ class CommandCBan : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector& parameters) CXX11_OVERRIDE + RouteDescriptor GetRouting(User* user, const Params& parameters) CXX11_OVERRIDE { if (IS_LOCAL(user)) return ROUTE_LOCALONLY; // spanningtree will send ADDLINE @@ -180,7 +186,7 @@ class ModuleCBan : public Module, public Stats::EventListener if (rl) { // Channel is banned. - user->WriteNumeric(384, cname, InspIRCd::Format("Cannot join channel, CBANed (%s)", rl->reason.c_str())); + user->WriteNumeric(ERR_BADCHANNEL, cname, InspIRCd::Format("Channel %s is CBANed: %s", cname.c_str(), rl->reason.c_str())); ServerInstance->SNO->WriteGlobalSno('a', "%s tried to join %s which is CBANed (%s)", user->nick.c_str(), cname.c_str(), rl->reason.c_str()); return MOD_RES_DENY;