1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 01:33:14 +02:00

Start migrating to range-based for loops.

This commit is contained in:
Sadie Powell
2023-10-10 21:14:50 +01:00
parent dc371aad6d
commit a3241065c5
146 changed files with 1157 additions and 1459 deletions
+11 -9
View File
@@ -19,46 +19,48 @@ class StatusUpdate : public Module
void OnAccessAdd(ChannelInfo *ci, CommandSource &, ChanAccess *access) override
{
if (ci->c)
for (Channel::ChanUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it)
{
for (const auto &[_, uc] : ci->c->users)
{
User *user = it->second->user;
User *user = uc->user;
ChannelInfo *next;
if (user->server != Me && access->Matches(user, user->Account(), next))
{
AccessGroup ag = ci->AccessFor(user);
for (unsigned i = 0; i < ModeManager::GetStatusChannelModesByRank().size(); ++i)
for (auto *cms : ModeManager::GetStatusChannelModesByRank())
{
ChannelModeStatus *cms = ModeManager::GetStatusChannelModesByRank()[i];
if (!ag.HasPriv("AUTO" + cms->name))
ci->c->RemoveMode(NULL, cms, user->GetUID());
}
ci->c->SetCorrectModes(user, true);
}
}
}
}
void OnAccessDel(ChannelInfo *ci, CommandSource &, ChanAccess *access) override
{
if (ci->c)
for (Channel::ChanUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it)
{
for (const auto &[_, uc] : ci->c->users)
{
User *user = it->second->user;
User *user = uc->user;
ChannelInfo *next;
if (user->server != Me && access->Matches(user, user->Account(), next))
{
AccessGroup ag = ci->AccessFor(user);
for (unsigned i = 0; i < ModeManager::GetStatusChannelModesByRank().size(); ++i)
for (auto *cms : ModeManager::GetStatusChannelModesByRank())
{
ChannelModeStatus *cms = ModeManager::GetStatusChannelModesByRank()[i];
if (!ag.HasPriv("AUTO" + cms->name))
if (!ag.HasPriv("AUTO" + cms->name))
ci->c->RemoveMode(NULL, cms, user->GetUID());
}
}
}
}
}
};