X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=9dcbcae0c9fbcc704f49cc9d1d52f5fd012ef60f;hb=853bfabbc777a3943f4de0436d87ea09a9863568;hp=246efd7cf868f85f12e806b6bb0ab3bcd0eb706f;hpb=046da7da9bf57ac9254f76fd1c43eadf1673cdf5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index 246efd7cf..9dcbcae0c 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -97,8 +97,6 @@ LocalUser::LocalUser(int myfd, irc::sockets::sockaddrs* client, irc::sockets::so User::~User() { - if (ServerInstance->FindUUID(uuid)) - ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "User destructor for %s called without cull", uuid.c_str()); } const std::string& User::MakeHost() @@ -330,7 +328,6 @@ CullResult User::cull() CullResult LocalUser::cull() { - ServerInstance->Users->local_users.erase(this); ClearInvites(); eh.cull(); return User::cull(); @@ -341,7 +338,7 @@ CullResult FakeUser::cull() // Fake users don't quit, they just get culled. quitting = true; // Fake users are not inserted into UserManager::clientlist, they're only in the uuidlist - ServerInstance->Users->uuidlist.erase(uuid); + // and they are removed from there by the linking mod when the server splits return User::cull(); } @@ -417,7 +414,7 @@ void OperInfo::init() { this->AllowedUserModes.set(); } - else if (*c >= 'A' && *c < 'z') + else if (*c >= 'A' && *c <= 'z') { this->AllowedUserModes[*c - 'A'] = true; } @@ -430,7 +427,7 @@ void OperInfo::init() { this->AllowedChanModes.set(); } - else if (*c >= 'A' && *c < 'z') + else if (*c >= 'A' && *c <= 'z') { this->AllowedChanModes[*c - 'A'] = true; } @@ -452,21 +449,16 @@ void User::UnOper() /* Remove all oper only modes from the user when the deoper - Bug #466*/ - std::string moderemove("-"); - - for (unsigned char letter = 'A'; letter <= 'z'; letter++) + Modes::ChangeList changelist; + 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()) - moderemove += letter; + ModeHandler* mh = i->second; + if (mh->NeedsOper()) + changelist.push_remove(mh); } - - std::vector parameters; - parameters.push_back(this->nick); - parameters.push_back(moderemove); - - ServerInstance->Modes->Process(parameters, this); + ServerInstance->Modes->Process(this, NULL, this, changelist); // Remove the user from the oper list stdalgo::vector::swaperase(ServerInstance->Users->all_opers, this);