summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/users.cpp7
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);
}