]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
m_modenotice Use WriteNotice()
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index 3602469bd61a052170c27ef456699d1b2c89089b..0801c9c52a3c62f829fabb95834720a49eb4a99a 100644 (file)
@@ -20,8 +20,6 @@
  */
 
 
-/* $ModDesc: Adds timed bans */
-
 #include "inspircd.h"
 
 /** Holds a timed ban
@@ -81,9 +79,9 @@ class CommandTban : public Command
                        mask.append("!*@*");
 
                setban.push_back(mask);
-               // use CallHandler to make it so that the user sets the mode
-               // themselves
-               ServerInstance->Parser->CallHandler("MODE",setban,user);
+               // Pass the user (instead of ServerInstance->FakeClient) to ModeHandler::Process() to
+               // make it so that the user sets the mode themselves
+               ServerInstance->Modes->Process(setban, user);
                if (ServerInstance->Modes->GetLastParse().empty())
                {
                        user->WriteNotice("Invalid ban mask");
@@ -152,9 +150,6 @@ class ModuleTimedBans : public Module
 
        void init() CXX11_OVERRIDE
        {
-               ServerInstance->Modules->AddService(cmd);
-               Implementation eventlist[] = { I_OnBackgroundTimer };
-               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
                ServerInstance->Modes->AddModeWatcher(&banwatcher);
        }