summaryrefslogtreecommitdiff
path: root/src/modules/m_joinflood.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_joinflood.cpp')
-rw-r--r--src/modules/m_joinflood.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index c7b5700d2..391f13b24 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -157,6 +157,33 @@ class JoinFlood : public ModeHandler
channel->SetModeParam('j', parameter.c_str(), true);
return MODEACTION_ALLOW;
}
+ else
+ {
+ std::string cur_param = channel->GetModeParameter('j');
+ parameter = ConvToStr(njoins) + ":" +ConvToStr(nsecs);
+ if (cur_param == parameter)
+ {
+ // mode params match
+ return MODEACTION_DENY;
+ }
+ else
+ {
+ // new mode param, replace old with new
+ if ((!nsecs) && (!njoins))
+ {
+ joinfloodsettings *f = new joinfloodsettings(nsecs,njoins);
+ channel->Shrink("joinflood");
+ channel->Extend("joinflood", f);
+ channel->SetModeParam('j', cur_param.c_str(), false);
+ channel->SetModeParam('j', parameter.c_str(), true);
+ return MODEACTION_ALLOW;
+ }
+ else
+ {
+ return MODEACTION_DENY;
+ }
+ }
+ }
}
}
else