diff options
author | Adam <Adam@anope.org> | 2012-12-27 15:03:38 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-12-27 15:03:38 -0500 |
commit | 05094b0da5dbf591ecea0dad1712fbe5fd8322f0 (patch) | |
tree | d1d1173552002a3f04a477cf55b0d1af7b829985 /src | |
parent | 4ab8a70b219608ffb4ebd0838f7f696ad1c48d65 (diff) |
When processing many modes don't enforce mlock until all are set
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/channels.cpp b/src/channels.cpp index f6d44e9f8..b3ccf0fad 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -346,7 +346,7 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *cm, const Anop if (param.empty() && cm->type != MODE_REGULAR) { - Log() << "Channel::SetModeInternal() mode " << cm->mchar << " for " << this->name << " with a paramater, but its not a param mode"; + Log() << "Channel::SetModeInternal() mode " << cm->mchar << " for " << this->name << " with no paramater, but is a param mode"; return; } @@ -635,7 +635,10 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode, if (!ts) ; else if (ts > this->creation_time) + { + Log(LOG_DEBUG) << "Dropping mode " << mode << " on " << this->name << ", " << ts << " > " << this->creation_time; return; + } else if (ts < this->creation_time) { Log(LOG_DEBUG) << "Changing TS of " << this->name << " from " << this->creation_time << " to " << ts; @@ -684,9 +687,9 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode, if (cm->type == MODE_REGULAR) { if (add) - this->SetModeInternal(source, cm, "", enforce_mlock); + this->SetModeInternal(source, cm, "", false); else - this->RemoveModeInternal(source, cm, "", enforce_mlock); + this->RemoveModeInternal(source, cm, "", false); continue; } else if (cm->type == MODE_PARAM) @@ -695,7 +698,7 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode, if (!add && cmp->minus_no_arg) { - this->RemoveModeInternal(source, cm, "", enforce_mlock); + this->RemoveModeInternal(source, cm, "", false); continue; } } @@ -709,9 +712,9 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode, paramstring += " " + token; if (add) - this->SetModeInternal(source, cm, token, enforce_mlock); + this->SetModeInternal(source, cm, token, false); else - this->RemoveModeInternal(source, cm, token, enforce_mlock); + this->RemoveModeInternal(source, cm, token, false); } else Log() << "warning: Channel::SetModesInternal() recieved more modes requiring params than params, modes: " << mode; @@ -724,6 +727,9 @@ void Channel::SetModesInternal(MessageSource &source, const Anope::string &mode, Log(setter, this, "mode") << modestring << paramstring; else Log(LOG_DEBUG) << source.GetName() << " is setting " << this->name << " to " << modestring << paramstring; + + if (enforce_mlock) + this->CheckModes(); } bool Channel::MatchesList(User *u, ChannelModeName mode) |