X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cban.cpp;h=4fb0653a91b1014e6da68ff377f9d17dfa5947df;hb=acccaa39641500b8a691db4136e6571102a438ed;hp=5e629ed42ffc70763a9d6d111fcad712a3f24271;hpb=48033e9b3a708f265c0bc2d62460a6cefa70dd45;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 5e629ed42..4fb0653a9 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -23,8 +23,6 @@ #include "inspircd.h" #include "xline.h" -/* $ModDesc: Gives /cban, aka C:lines. Think Q:lines, for channels. */ - /** Holds a CBAN item */ class CBan : public XLine @@ -34,7 +32,7 @@ private: irc::string matchtext; public: - CBan(time_t s_time, long d, std::string src, std::string re, std::string ch) + CBan(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& ch) : XLine(s_time, d, src, re, "CBAN") { this->displaytext = ch; @@ -88,7 +86,6 @@ class CommandCBan : public Command CommandCBan(Module* Creator) : Command(Creator, "CBAN", 1, 3) { flags_needed = 'o'; this->syntax = " [ :]"; - TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END); } CmdResult Handle(const std::vector ¶meters, User *user) @@ -124,7 +121,7 @@ class CommandCBan : public Command else { time_t c_requires_crap = duration + ServerInstance->Time(); - std::string timestr = ServerInstance->TimeString(c_requires_crap); + std::string timestr = InspIRCd::TimeString(c_requires_crap); ServerInstance->SNO->WriteGlobalSno('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), timestr.c_str(), reason); } } @@ -160,10 +157,6 @@ class ModuleCBan : public Module void init() CXX11_OVERRIDE { ServerInstance->XLines->RegisterFactory(&f); - - ServerInstance->Modules->AddService(mycommand); - Implementation eventlist[] = { I_OnUserPreJoin, I_OnStats }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } ~ModuleCBan() @@ -188,7 +181,7 @@ class ModuleCBan : public Module if (rl) { // Channel is banned. - user->WriteServ( "384 %s %s :Cannot join channel, CBANed (%s)", user->nick.c_str(), cname.c_str(), rl->reason.c_str()); + user->WriteNumeric(384, "%s :Cannot join channel, 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;