1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 22:26:39 +02:00

Properly store our clients internal channel status's and burst them if needed.

Also made Flag::HasFlag use test() instead of operator[] to catch errors, and fixed an out of bounds access to a
Flags
bitset causing crashes on some systems.
This commit is contained in:
Adam
2010-08-28 20:56:45 -04:00
parent 26ba944d55
commit e820e1af0d
12 changed files with 39 additions and 26 deletions
+14 -3
View File
@@ -82,10 +82,21 @@ void Channel::Reset()
{
UserContainer *uc = *it;
if (findbot(uc->user->nick))
continue;
Flags<ChannelModeName, CMODE_END * 2> flags = *debug_cast<Flags<ChannelModeName, CMODE_END * 2> *>(uc->Status);
uc->Status->ClearFlags();
if (findbot(uc->user->nick))
{
for (std::map<char, ChannelMode *>::iterator mit = ModeManager::ChannelModesByChar.begin(), mit_end = ModeManager::ChannelModesByChar.end(); mit != mit_end; ++mit)
{
ChannelMode *cm = mit->second;
if (flags.HasFlag(cm->Name))
{
this->SetMode(NULL, cm, uc->user->nick, false);
}
}
}
}
check_modes(this);