diff options
author | Adam <Adam@drink-coca-cola.info> | 2010-05-15 00:56:52 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-18 21:01:55 -0400 |
commit | ee57f5719301c3883afcffe5970746f378960917 (patch) | |
tree | 994ac1f0dbc675e9950050a2332bb17da79d5f02 /src/modes.cpp | |
parent | c966d7ec17690037a597e1d8908782de376f3052 (diff) |
Store modes in users and channels using the Flags class, cleaner
Diffstat (limited to 'src/modes.cpp')
-rw-r--r-- | src/modes.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/modes.cpp b/src/modes.cpp index 1e725cf7f..935d1e1b3 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -30,9 +30,9 @@ std::map<ChannelModeName, ChannelMode *> ModeManager::ChannelModesByName; /* Number of generic modes we support */ unsigned GenericChannelModes = 0, GenericUserModes = 0; /* Default mlocked modes on */ -std::bitset<128> DefMLockOn; +Flags<ChannelModeName> DefMLockOn; /* Default mlocked modes off */ -std::bitset<128> DefMLockOff; +Flags<ChannelModeName> DefMLockOff; /* Map for default mlocked mode parameters */ std::map<ChannelModeName, std::string> DefMLockParams; /* Modes to set on bots when they join the channel */ @@ -42,10 +42,10 @@ std::list<ChannelModeStatus *> BotModes; */ void SetDefaultMLock() { - DefMLockOn.reset(); - DefMLockOff.reset(); + DefMLockOn.ClearFlags(); + DefMLockOff.ClearFlags(); DefMLockParams.clear(); - std::bitset<128> *ptr = NULL; + Flags<ChannelModeName> *ptr = NULL; std::string modes, param; spacesepstream sep(Config.MLock); @@ -66,9 +66,9 @@ void SetDefaultMLock() if (cm && (cm->Type == MODE_REGULAR || cm->Type == MODE_PARAM)) { - ptr->set(cm->Name); + ptr->SetFlag(cm->Name); - if (*ptr == DefMLockOn && cm->Type == MODE_PARAM) + if (ptr == &DefMLockOn && cm->Type == MODE_PARAM) { if (sep.GetToken(param)) { @@ -77,7 +77,7 @@ void SetDefaultMLock() else { Alog() << "Warning: Got default mlock mode " << cm->ModeChar << " with no param?"; - ptr->set(cm->Name, false); + ptr->UnsetFlag(cm->Name); } } } |