]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cban.cpp
Fix some oversights
[user/henk/code/inspircd.git] / src / modules / m_cban.cpp
index 7dedb74415c214ff3511337b1dfcad3a553d27bb..4fb0653a91b1014e6da68ff377f9d17dfa5947df 100644 (file)
@@ -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
@@ -88,7 +86,6 @@ class CommandCBan : public Command
        CommandCBan(Module* Creator) : Command(Creator, "CBAN", 1, 3)
        {
                flags_needed = 'o'; this->syntax = "<channel> [<duration> :<reason>]";
-               TRANSLATE4(TR_TEXT,TR_TEXT,TR_TEXT,TR_END);
        }
 
        CmdResult Handle(const std::vector<std::string> &parameters, 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;