added possibility to recover connections using Login on Connect
[ircu2.10.12-pk.git] / ircd / m_nick.c
index 3c069f7b68ffbd161193c3f80bd803c974a988e5..fd1cb0c29280381ba1b037227c67956a02bf1500 100644 (file)
@@ -96,6 +96,7 @@
 #include "s_debug.h"
 #include "s_misc.h"
 #include "s_user.h"
+#include "s_auth.h"
 #include "send.h"
 #include "sys.h"
 
@@ -256,6 +257,14 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     exit_client(cptr, acptr, &me, "Overridden by other sign on");
     return set_nick_name(cptr, sptr, nick, parc, parv, 0);
   }
+  /*
+   * If the Nickname is in use by a Zombie, wait for possible LOC information
+   * to recover the zombie connection...
+   */
+  if(IsNotConn(acptr) && !(cli_name(sptr))[0]) {
+    auth_set_recover_client(cli_auth(sptr), acptr);
+    return set_nick_name(cptr, sptr, nick, parc, parv, 1);
+  }
   /*
    * NICK is coming from local client connection. Just
    * send error reply and ignore the command.