diff options
-rw-r--r-- | src/usermanager.cpp | 6 | ||||
-rw-r--r-- | src/users.cpp | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 68576f331..d930fd039 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -178,9 +178,11 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char return; } - ServerInstance->Logs->Log("USERS", DEBUG,"QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str()); - user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str()); user->quitting = true; + + ServerInstance->Logs->Log("USERS", DEBUG, "QuitUser: %s '%s'", user->nick.c_str(), quitreason.c_str()); + user->Write("ERROR :Closing link: (%s@%s) [%s]", user->ident.c_str(), user->host.c_str(), *operreason ? operreason : quitreason.c_str()); + user->quietquit = false; user->quitmsg = quitreason; diff --git a/src/users.cpp b/src/users.cpp index 6bafe5738..a755c4dd7 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -671,10 +671,7 @@ std::string User::GetBuffer() void User::AddWriteBuf(const std::string &data) { - if (this->quitting) - return; - - if (this->MyClass && !this->HasPrivPermission("users/flood/increased-buffers") && sendq.length() + data.length() > this->MyClass->GetSendqMax()) + if (!this->quitting && this->MyClass && !this->HasPrivPermission("users/flood/increased-buffers") && sendq.length() + data.length() > this->MyClass->GetSendqMax()) { /* * Fix by brain - Set the error text BEFORE calling, because @@ -686,6 +683,9 @@ void User::AddWriteBuf(const std::string &data) return; } + // We still want to append data to the sendq of a quitting user, + // e.g. their ERROR message that says 'closing link' + if (data.length() > MAXBUF - 2) /* MAXBUF has a value of 514, to account for line terminators */ sendq.append(data.substr(0,MAXBUF - 4)).append("\r\n"); /* MAXBUF-4 = 510 */ else |