]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/usermanager.cpp
Fix for bug #652, reported by Ankit: blank reply from /userip with no target online...
[user/henk/code/inspircd.git] / src / usermanager.cpp
index 521dcec417d18765f6943257f56f04e560c8aacf..33d172543574a0e47818e81e27fb1c5ead091798 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -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;