Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_user.c
index 55ac6a8a1a136feb5051d5c816be9a9a51eafffd..efbe6eb853e2ccef30aba8b684815709159e8a2e 100644 (file)
@@ -85,6 +85,7 @@
 #include "client.h"
 #include "ircd.h"
 #include "ircd_chattr.h"
+#include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "numeric.h"
@@ -94,7 +95,7 @@
 #include "s_user.h"
 #include "send.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -143,11 +144,13 @@ int m_user(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   user->server = &me;
   ircd_strncpy(cli_info(cptr), info, REALLEN);
 
-  if ((cli_name(cptr))[0] && cli_cookie(cptr) == COOKIE_VERIFIED) {
+  cli_unreg(sptr) &= ~CLIREG_USER; /* username now set */
+
+  if (!cli_unreg(sptr)) {
     /*
      * NICK and PONG already received, now we have USER...
      */
-    return register_user(cptr, sptr, cli_name(sptr), username, 0);
+    return register_user(cptr, sptr, cli_name(sptr), username);
   }
   else {
     ircd_strncpy(user->username, username, USERLEN);