summaryrefslogtreecommitdiff
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-10 22:56:09 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-03-10 22:56:09 +0000
commit875b54b33c2063378aaefae58d70a99656e1bf24 (patch)
tree6485179c226207c541d98bcce514e629704aeee3 /src/usermanager.cpp
parent516825e9ddd5f91359ac3cca51e8d8e9070dc96f (diff)
Fix fast quit/connect by changing nick to UID on QuitUser
This requires moving the sending of the QUIT back to usermanager from cull_list in order to prevent client desyncs. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11203 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp
index f8b1f0de2..cf068171d 100644
--- a/src/usermanager.cpp
+++ b/src/usermanager.cpp
@@ -184,12 +184,33 @@ void UserManager::QuitUser(User *user, const std::string &quitreason, const char
user->quietquit = false;
user->quitmsg = quitreason;
+ std::string reason;
+ std::string oper_reason;
+ reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit);
if (!*operreason)
+ {
user->operquitmsg = quitreason;
+ oper_reason.assign(quitreason, 0, ServerInstance->Config->Limits.MaxQuit);
+ }
else
+ {
user->operquitmsg = operreason;
+ oper_reason.assign(operreason, 0, ServerInstance->Config->Limits.MaxQuit);
+ }
ServerInstance->GlobalCulls.AddItem(user);
+
+ if (user->registered == REG_ALL)
+ {
+ FOREACH_MOD_I(ServerInstance,I_OnUserQuit,OnUserQuit(user, reason, oper_reason));
+ user->PurgeEmptyChannels();
+ user->WriteCommonQuit(reason, oper_reason);
+ }
+
+ FOREACH_MOD_I(ServerInstance,I_OnUserDisconnect,OnUserDisconnect(user));
+
+ // Move the user onto their UID, to allow nick to be reused immediately
+ user->UpdateNickHash(user->uuid.c_str());
}