]> jfr.im git - solanum.git/blobdiff - modules/m_user.c
appveyor: sanity check gcc itself
[solanum.git] / modules / m_user.c
index 982621aea350d59835a69f2f0cef669124ffce80..cd8c7c13619344987daea9c741fb764ff2584070 100644 (file)
 #include "blacklist.h"
 #include "s_assert.h"
 
-static int mr_user(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char user_desc[] =
+       "Provides the USER command to register a new connection";
+
+static void mr_user(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message user_msgtab = {
        "USER", 0, 0, 0, 0,
@@ -44,10 +47,10 @@ struct Message user_msgtab = {
 };
 
 mapi_clist_av1 user_clist[] = { &user_msgtab, NULL };
-DECLARE_MODULE_AV1(user, NULL, NULL, user_clist, NULL, NULL, "$Revision: 3416 $");
+DECLARE_MODULE_AV2(user, NULL, NULL, user_clist, NULL, NULL, NULL, NULL, user_desc);
 
-static int do_local_user(struct Client *client_p, struct Client *source_p,
-                        const char *username, const char *realname);
+static void do_local_user(struct Client *client_p, struct Client *source_p,
+               const char *username, const char *realname);
 
 /* mr_user()
  *      parv[1] = username (login name, account)
@@ -55,7 +58,7 @@ static int do_local_user(struct Client *client_p, struct Client *source_p,
  *      parv[3] = server host name (ignored)
  *      parv[4] = users gecos
  */
-static int
+static void
 mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        static char buf[BUFSIZE];
@@ -64,11 +67,11 @@ mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
        if (strlen(client_p->id) == 3)
        {
                exit_client(client_p, client_p, client_p, "Mixing client and server protocol");
-               return 0;
+               return;
        }
 
        if(source_p->flags & FLAGS_SENTUSER)
-               return 0;
+               return;
 
        if((p = strchr(parv[1], '@')))
                *p = '\0';
@@ -78,10 +81,9 @@ mr_user(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
        source_p->localClient->fullcaps = rb_strdup(buf);
 
        do_local_user(client_p, source_p, parv[1], parv[4]);
-       return 0;
 }
 
-static int
+static void
 do_local_user(struct Client *client_p, struct Client *source_p,
              const char *username, const char *realname)
 {
@@ -101,8 +103,6 @@ do_local_user(struct Client *client_p, struct Client *source_p,
        if(source_p->name[0])
        {
                /* NICK already received, now I have USER... */
-               return register_local_user(client_p, source_p);
+               register_local_user(client_p, source_p);
        }
-
-       return 0;
 }