X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fusers.cpp;h=34986a1833073f4629fccff7b383871acc55185f;hb=e0412d5161891c04faf2050cc02e8a9cffdda8a4;hp=8d22d166ced3500ccfdc7c57ebe367bb5c9cabbb;hpb=f62654a6859998f9d63eb22702c572d5ebcff15c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/users.cpp b/src/users.cpp index 8d22d166c..34986a183 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() @@ -279,7 +277,7 @@ void UserIOHandler::OnDataReady() return; eol_found: // just found a newline. Terminate the string, and pull it out of recvq - recvq = recvq.substr(qpos); + recvq.erase(0, qpos); // TODO should this be moved to when it was inserted in recvq? ServerInstance->stats.Recv += qpos; @@ -340,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(); } @@ -451,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); @@ -771,7 +764,7 @@ void LocalUser::Write(const std::string& text) if (text.length() > ServerInstance->Config->Limits.MaxLine - 2) { // this should happen rarely or never. Crop the string at 512 and try again. - std::string try_again = text.substr(0, ServerInstance->Config->Limits.MaxLine - 2); + std::string try_again(0, ServerInstance->Config->Limits.MaxLine - 2); Write(try_again); return; }