]> jfr.im git - solanum.git/blobdiff - modules/m_user.c
msg: remove last vestiges of the fakelag system. charybdis has never supported fakelag.
[solanum.git] / modules / m_user.c
index 94a6577d2fef75a8006c1c80ebd57d2d073431bc..060f0815a47ff1f9aadffe278d9ff8c1c32a1c94 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "stdinc.h"
 #include "client.h"
-#include "irc_string.h"
+#include "match.h"
 #include "ircd.h"
 #include "numeric.h"
 #include "s_user.h"
 #include "parse.h"
 #include "modules.h"
 #include "blacklist.h"
+#include "s_assert.h"
 
-static int mr_user(struct Client *, struct Client *, int, const char **);
+static int mr_user(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message user_msgtab = {
-       "USER", 0, 0, 0, MFLG_SLOW,
+       "USER", 0, 0, 0, 0,
        {{mr_user, 5}, mg_reg, mg_ignore, mg_ignore, mg_ignore, mg_reg}
 };
 
@@ -57,7 +58,7 @@ static int do_local_user(struct Client *client_p, struct Client *source_p,
  *      parv[4] = users gecos
  */
 static int
-mr_user(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static char buf[BUFSIZE];
        char *p;
@@ -68,10 +69,13 @@ mr_user(struct Client *client_p, struct Client *source_p, int parc, const char *
                return 0;
        }
 
+       if(source_p->flags & FLAGS_SENTUSER)
+               return 0;
+
        if((p = strchr(parv[1], '@')))
                *p = '\0';
 
-       rb_snprintf(buf, sizeof(buf), "%s %s", parv[2], parv[3]);
+       snprintf(buf, sizeof(buf), "%s %s", parv[2], parv[3]);
        rb_free(source_p->localClient->fullcaps);
        source_p->localClient->fullcaps = rb_strdup(buf);
 
@@ -83,33 +87,23 @@ static int
 do_local_user(struct Client *client_p, struct Client *source_p,
              const char *username, const char *realname)
 {
-       struct User *user;
-
        s_assert(NULL != source_p);
        s_assert(source_p->username != username);
 
-       user = make_user(source_p);
+       make_user(source_p);
 
-       if (!(source_p->flags & FLAGS_SENTUSER))
-       {
-               lookup_blacklists(source_p);
-               source_p->flags |= FLAGS_SENTUSER;
-       }
+       lookup_blacklists(source_p);
+       source_p->flags |= FLAGS_SENTUSER;
 
        rb_strlcpy(source_p->info, realname, sizeof(source_p->info));
 
        if(!IsGotId(source_p))
-       {
-               /* This is in this location for a reason..If there is no identd
-                * and ping cookies are enabled..we need to have a copy of this
-                */
                rb_strlcpy(source_p->username, username, sizeof(source_p->username));
-       }
 
        if(source_p->name[0])
        {
                /* NICK already received, now I have USER... */
-               return register_local_user(client_p, source_p, username);
+               return register_local_user(client_p, source_p);
        }
 
        return 0;