]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/irc-metadata.c
Update #include's: remove unused and add missing ones
[ngircd.git] / src / ngircd / irc-metadata.c
index 14ffe351ed6a98984a6eac0f0c8e9fc39c13e818..463060b410f39146b83d5014ec4ccf018e8a78a3 100644 (file)
  * IRC metadata commands
  */
 
-#include "imp.h"
 #include <assert.h>
-#include <string.h>
+#include <strings.h>
 #include <stdio.h>
 
 #include "conn-func.h"
 #include "channel.h"
-#include "conn-encoding.h"
 #include "irc-write.h"
 #include "log.h"
 #include "messages.h"
 #include "parse.h"
-#include "tool.h"
-
-#include "exp.h"
-#include "irc-metadata.h"
 
 /**
  * Handler for the IRC+ "METADATA" command.
@@ -51,10 +45,6 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req)
        assert(Client != NULL);
        assert(Req != NULL);
 
-       if (Req->argc != 3)
-               return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
-                                         Client_ID(Client), Req->command);
-
        prefix = Client_Search(Req->prefix);
        if (!prefix)
                return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
@@ -69,7 +59,7 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req)
                 Client_ID(prefix), Client_ID(target),
                 Req->argv[1], Req->argv[2]);
 
-       /* Mark client: it has receiveda a METADATA command */
+       /* Mark client: it has received a METADATA command */
        if (!Client_HasFlag(target, 'M')) {
                snprintf(new_flags, sizeof new_flags, "%sM",
                         Client_Flags(target));
@@ -96,6 +86,8 @@ IRC_METADATA(CLIENT *Client, REQUEST *Req)
                Client_SetInfo(target, Req->argv[2]);
        else if (*Req->argv[2] && strcasecmp(Req->argv[1], "user") == 0)
                Client_SetUser(target, Req->argv[2], true);
+       else if (strcasecmp(Req->argv[1], "accountname") == 0)
+               Client_SetAccountName(target, Req->argv[2]);
        else if (*Req->argv[2] && strcasecmp(Req->argv[1], "certfp") == 0)
                Conn_SetCertFp(Client_Conn(target), Req->argv[2]);
        else