aboutsummaryrefslogtreecommitdiffstats
path: root/src/users.cpp
diff options
context:
space:
mode:
authorGravatar attilamolnar2013-06-18 19:17:39 +0200
committerGravatar attilamolnar2013-07-19 19:40:05 +0200
commit2dc01893c67fedb7b249773c43bc83b46086ee5f (patch)
tree40a1bc5936628b98b4ae0c0c9427b44cf2cf1809 /src/users.cpp
parentReplace hardcoded mode letters, part 3 (diff)
downloadinspircd++-2dc01893c67fedb7b249773c43bc83b46086ee5f.tar.gz
inspircd++-2dc01893c67fedb7b249773c43bc83b46086ee5f.tar.bz2
inspircd++-2dc01893c67fedb7b249773c43bc83b46086ee5f.zip
Get rid of enum UserModes and mark User::modes as private
Diffstat (limited to 'src/users.cpp')
-rw-r--r--src/users.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/users.cpp b/src/users.cpp
index f4055d464..fe593a139 100644
--- a/src/users.cpp
+++ b/src/users.cpp
@@ -367,10 +367,11 @@ CullResult FakeUser::cull()
void User::Oper(OperInfo* info)
{
- if (this->IsModeSet('o'))
+ ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
+ if (this->IsModeSet(opermh))
this->UnOper();
- this->modes[UM_OPERATOR] = 1;
+ this->SetMode(opermh, true);
this->oper = info;
this->WriteServ("MODE %s :+o", this->nick.c_str());
FOREACH_MOD(I_OnOper, OnOper(this, info->name));
@@ -490,7 +491,8 @@ void User::UnOper()
/* remove the user from the oper list. Will remove multiple entries as a safeguard against bug #404 */
ServerInstance->Users->all_opers.remove(this);
- this->modes[UM_OPERATOR] = 0;
+ ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER);
+ this->SetMode(opermh, false);
}
/*