]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/usermanager.cpp
Create the core_xline module
[user/henk/code/inspircd.git] / src / usermanager.cpp
index 13646f225c2abf1e75d6b1e4b6f7b16a7ef8ed97..12db0dde2fb406d0fa0a43efc86db79594372eb0 100644 (file)
@@ -83,7 +83,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
 
        this->local_users.push_front(New);
 
-       if ((this->local_users.size() > ServerInstance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)ServerInstance->SE->GetMaxFds()))
+       if ((this->local_users.size() > ServerInstance->Config->SoftLimit) || (this->local_users.size() >= (unsigned int)SocketEngine::GetMaxFds()))
        {
                ServerInstance->SNO->WriteToSnoMask('a', "Warning: softlimit value has been reached: %d clients", ServerInstance->Config->SoftLimit);
                this->QuitUser(New,"No more connections allowed");
@@ -141,7 +141,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, irc::sockets::sockaddrs
                }
        }
 
-       if (!ServerInstance->SE->AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
+       if (!SocketEngine::AddFd(eh, FD_WANT_FAST_READ | FD_WANT_EDGE_WRITE))
        {
                ServerInstance->Logs->Log("USERS", LOG_DEBUG, "Internal error on new connection");
                this->QuitUser(New, "Internal error handling connection");
@@ -209,6 +209,7 @@ void UserManager::QuitUser(User* user, const std::string& quitreason, const std:
                ServerInstance->Logs->Log("USERS", LOG_DEFAULT, "ERROR: Nick not found in clientlist, cannot remove: " + user->nick);
 
        uuidlist->erase(user->uuid);
+       user->PurgeEmptyChannels();
 }
 
 void UserManager::AddLocalClone(User *user)
@@ -336,7 +337,7 @@ void UserManager::DoBackgroundUserStuff()
                                        if (!curr->lastping)
                                        {
                                                time_t time = ServerInstance->Time() - (curr->nping - curr->MyClass->GetPingTime());
-                                               const std::string message = "Ping timeout: " + ConvToStr(time) + (time == 1 ? " seconds" : " second");
+                                               const std::string message = "Ping timeout: " + ConvToStr(time) + (time != 1 ? " seconds" : " second");
                                                this->QuitUser(curr, message);
                                                continue;
                                        }