1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 04:03:12 +02:00

Store modes as their object form in ModeStatus.

This has the side effect of preventing users from putting nonsense
modes in {botserv}:botmodes and other related fields.
This commit is contained in:
Sadie Powell
2026-02-16 23:17:40 +00:00
parent 2f1f04f7cb
commit d43acc2381
14 changed files with 60 additions and 48 deletions
+3 -3
View File
@@ -200,8 +200,8 @@ private:
memb->status.Clear();
BotInfo *setter = BotInfo::Find(user->GetUID());
for (auto mode : cs.Modes())
c->SetMode(setter, ModeManager::FindChannelModeByChar(mode), user->GetUID(), false);
for (auto *mode : cs.Modes())
c->SetMode(setter, mode, user->GetUID(), false);
if (memb != NULL)
memb->status = cs;
@@ -554,7 +554,7 @@ namespace UnrealExtBan
{
auto *memb = c->FindUser(u);
if (memb != NULL)
if (cm == NULL || memb->status.HasMode(cm->mchar))
if (cm == NULL || memb->status.HasMode(cm))
return true;
}