]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_timedbans.cpp
m_spanningtree Remove duplicate code for sending channel messages from RouteCommand()
[user/henk/code/inspircd.git] / src / modules / m_timedbans.cpp
index 6a885a2fe12f82f234853f874c97db006b5f79e5..29691b338b54161f6e0dcf6d7b9707f9696ab142 100644 (file)
@@ -79,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");
@@ -151,8 +151,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);
        }