From 125a7442f72800dc86b58bcd53e54eb73c3732af Mon Sep 17 00:00:00 2001 From: w00t Date: Mon, 17 Nov 2008 19:45:38 +0000 Subject: Fix recursion in QuitUser git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10809 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cull_list.cpp | 7 ------- src/usermanager.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cull_list.cpp b/src/cull_list.cpp index bfbe518cb..2ec3799cc 100644 --- a/src/cull_list.cpp +++ b/src/cull_list.cpp @@ -23,13 +23,6 @@ CullList::CullList(InspIRCd* Instance) : ServerInstance(Instance) void CullList::AddItem(User* user) { - if (user->quitting) - { - ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a user (%s) twice. Did your module call QuitUser twice?", user->nick.c_str()); - return; - } - - user->quitting = true; list.push_back(user); } diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 521dcec41..58c9b4e3e 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -172,8 +172,15 @@ void UserManager::AddUser(InspIRCd* Instance, int socket, int port, bool iscache void UserManager::QuitUser(User *user, const std::string &quitreason, const char* operreason) { + if (user->quitting) + { + ServerInstance->Logs->Log("CULLLIST",DEBUG, "*** Warning *** - You tried to quit a user (%s) twice. Did your module call QuitUser twice?", user->nick.c_str()); + 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; user->quietquit = false; user->quitmsg = quitreason; -- cgit v1.2.3