diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-09-05 15:06:21 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-09-05 15:06:21 +0200 |
commit | 706b5a5a5bebb7fb25f2ec91a9fe48837ec200c8 (patch) | |
tree | a942766b133a0aa9d51a9c1f714820a6b32153f8 | |
parent | 0f15b0869703c20277c181f95ed38f2b2a5c1e04 (diff) |
Unset oper-only modes in User::UnOper() in a more sensible way
Get the user mode list from the ModeParser instead of trying all possible mode letters
-rw-r--r-- | src/users.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp index 4f9b6c945..9dcbcae0c 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -450,10 +450,11 @@ void User::UnOper() /* Remove all oper only modes from the user when the deoper - Bug #466*/ Modes::ChangeList changelist; - for (unsigned char letter = 'A'; letter <= 'z'; letter++) + const ModeParser::ModeHandlerMap& usermodes = ServerInstance->Modes->GetModes(MODETYPE_USER); + for (ModeParser::ModeHandlerMap::const_iterator i = usermodes.begin(); i != usermodes.end(); ++i) { - ModeHandler* mh = ServerInstance->Modes->FindMode(letter, MODETYPE_USER); - if (mh && mh->NeedsOper()) + ModeHandler* mh = i->second; + if (mh->NeedsOper()) changelist.push_remove(mh); } |