X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=f11a7a38079e43d3fba28c9fc914f1ce0fcc3deb;hb=aea67c2520b9abbd3be702914b025e1b2a37e046;hp=8f20b7523fca082dd751f4d8812660c7f37e95ed;hpb=c6e40d36b42a7ebf832c3a57d2816a47ee9c9a76;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index 8f20b7523..f11a7a380 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -357,10 +357,12 @@ CullResult FakeUser::cull() void User::Oper(OperInfo* info) { ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER); - if (this->IsModeSet(opermh)) - this->UnOper(); - - this->SetMode(opermh, true); + if (opermh) + { + if (this->IsModeSet(opermh)) + this->UnOper(); + this->SetMode(opermh, true); + } this->oper = info; LocalUser* localuser = IS_LOCAL(this); @@ -474,7 +476,8 @@ void User::UnOper() stdalgo::vector::swaperase(ServerInstance->Users->all_opers, this); ModeHandler* opermh = ServerInstance->Modes->FindMode('o', MODETYPE_USER); - this->SetMode(opermh, false); + if (opermh) + this->SetMode(opermh, false); FOREACH_MOD(OnPostDeoper, (this)); } @@ -1161,8 +1164,6 @@ void User::PurgeEmptyChannels() ++i; c->DelUser(this); } - - this->UnOper(); } void User::WriteNotice(const std::string& text)