1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 21:43:13 +02:00

Made the mode bouncing detector harder to hit and ignore syncing channels

This commit is contained in:
Adam
2013-02-18 22:10:57 -05:00
parent a49d7b12cb
commit cb91f991a3
2 changed files with 24 additions and 11 deletions
+23 -8
View File
@@ -125,13 +125,6 @@ void Channel::CheckModes()
return;
}
if (this->chanserv_modetime != Anope::CurTime)
{
this->chanserv_modecount = 0;
this->chanserv_modetime = Anope::CurTime;
}
this->chanserv_modecount++;
EventReturn MOD_RESULT;
FOREACH_RESULT(I_OnCheckModes, OnCheckModes(this));
if (MOD_RESULT == EVENT_STOP)
@@ -484,6 +477,17 @@ void Channel::SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string &param,
return;
}
if (Me->IsSynced())
{
if (this->chanserv_modetime != Anope::CurTime)
{
this->chanserv_modecount = 0;
this->chanserv_modetime = Anope::CurTime;
}
this->chanserv_modecount++;
}
ModeManager::StackerAdd(bi, this, cm, true, param);
MessageSource ms(bi);
SetModeInternal(ms, cm, param, enforce_mlock);
@@ -524,6 +528,17 @@ void Channel::RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string &para
this->GetParam(cmp->name, realparam);
}
if (Me->IsSynced())
{
if (this->chanserv_modetime != Anope::CurTime)
{
this->chanserv_modecount = 0;
this->chanserv_modetime = Anope::CurTime;
}
this->chanserv_modecount++;
}
ModeManager::StackerAdd(bi, this, cm, false, realparam);
MessageSource ms(bi);
RemoveModeInternal(ms, cm, realparam, enforce_mlock);
@@ -616,7 +631,7 @@ void Channel::SetModes(BotInfo *bi, bool enforce_mlock, const char *cmodes, ...)
void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts, bool enforce_mlock)
{
if (source.GetServer())
if (source.GetServer() && source.GetServer()->IsSynced())
{
if (Anope::CurTime != this->server_modetime)
{