]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_messageflood.cpp
Include untranslated user/channel metadata in CHECK output
[user/henk/code/inspircd.git] / src / modules / m_messageflood.cpp
index 2342870b8e55cde20be5e190cd7d65f99c35bd65..087d8e47ee950aadeeb3694a5cf24b1689488907 100644 (file)
@@ -87,12 +87,6 @@ class MsgFlood : public ModeHandler
                        return std::make_pair(false, parameter);
        }
 
-       bool CheckTimeStamp(time_t theirs, time_t ours, const std::string &their_param, const std::string &our_param, Channel* channel)
-       {
-               /* When TS is equal, the alphabetically later one wins */
-               return (their_param < our_param);
-       }
-
        ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool)
        {
                floodsettings *f;
@@ -198,17 +192,14 @@ class MsgFlood : public ModeHandler
 
 class ModuleMsgFlood : public Module
 {
-
-       MsgFlood* mf;
+       MsgFlood mf;
 
  public:
 
        ModuleMsgFlood(InspIRCd* Me)
-               : Module(Me)
+               : Module(Me), mf(Me)
        {
-
-               mf = new MsgFlood(ServerInstance);
-               if (!ServerInstance->Modes->AddMode(mf))
+               if (!ServerInstance->Modes->AddMode(&mf))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnChannelDelete, I_OnUserPreNotice, I_OnUserPreMessage };
                ServerInstance->Modules->Attach(eventlist, this, 3);
@@ -284,8 +275,7 @@ class ModuleMsgFlood : public Module
 
        virtual ~ModuleMsgFlood()
        {
-               ServerInstance->Modes->DelMode(mf);
-               delete mf;
+               ServerInstance->Modes->DelMode(&mf);
        }
 
        virtual Version GetVersion()