+ else
+ {
+ joinfloodsettings* f = ext.get(channel);
+ if (f)
+ {
+ ext.unset(channel);
+ channel->SetModeParam('j', "");
+ return MODEACTION_ALLOW;
+ }
+ }
+ return MODEACTION_DENY;
+ }
+};
+
+class ModuleJoinFlood : public Module
+{
+
+ JoinFlood jf;
+
+ public:
+
+ ModuleJoinFlood()
+ : jf(this)
+ {
+
+ if (!ServerInstance->Modes->AddMode(&jf))
+ throw ModuleException("Could not add new modes!");
+ Extensible::Register(&jf.ext);
+ Implementation eventlist[] = { I_OnChannelDelete, I_OnUserPreJoin, I_OnUserJoin };
+ ServerInstance->Modules->Attach(eventlist, this, 3);