+ else
+ {
+ if (channel->GetExt("flood", f))
+ {
+ delete f;
+ channel->Shrink("flood");
+ channel->SetModeParam('f', "");
+ return MODEACTION_ALLOW;
+ }
+ }
+
+ return MODEACTION_DENY;
+ }
+};
+
+class ModuleMsgFlood : public Module
+{
+
+ MsgFlood* mf;
+
+ public:
+
+ ModuleMsgFlood(InspIRCd* Me)
+ : Module(Me)
+ {
+
+ mf = new MsgFlood(ServerInstance);
+ 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);