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:
+14
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user