]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/irc-server.c
Introduce new function IRC_WriteErrClient()
[ngircd.git] / src / ngircd / irc-server.c
index 8fc575f3d86597b9576fb6f2cc503b292264680a..72acf79cdf593b0e3f132a789dcfccf3691359a2 100644 (file)
@@ -62,7 +62,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
 
        /* Return an error if this is not a local client */
        if (Client_Conn(Client) <= NONE)
-               return IRC_WriteStrClient(Client, ERR_UNKNOWNCOMMAND_MSG,
+               return IRC_WriteErrClient(Client, ERR_UNKNOWNCOMMAND_MSG,
                                          Client_ID(Client), Req->command);
 
        if (Client_Type(Client) == CLIENT_GOTPASS ||
@@ -73,7 +73,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                        Client_Conn(Client));
 
                if (Req->argc != 2 && Req->argc != 3)
-                       return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+                       return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
                                                  Client_ID(Client),
                                                  Req->command);
 
@@ -82,7 +82,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                        if (strcasecmp(Req->argv[0], Conf_Server[i].name) == 0)
                                break;
 
-               /* Makre sure the remote server is configured here */
+               /* Make sure the remote server is configured here */
                if (i >= MAX_SERVERS) {
                        Log(LOG_ERR,
                            "Connection %d: Server \"%s\" not configured here!",
@@ -152,7 +152,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                Client_SetType(Client, CLIENT_UNKNOWNSERVER);
 
 #ifdef ZLIB
-               if (strchr(Client_Flags(Client), 'Z')
+               if (Client_HasFlag(Client, 'Z')
                    && !Zip_InitConn(Client_Conn(Client))) {
                        Conn_Close(Client_Conn(Client),
                                   "Can't initialize compression (zlib)!",
@@ -162,7 +162,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
 #endif
 
 #ifdef IRCPLUS
-               if (strchr(Client_Flags(Client), 'H')) {
+               if (Client_HasFlag(Client, 'H')) {
                        LogDebug("Peer supports IRC+ extended server handshake ...");
                        if (!IRC_Send_ISUPPORT(Client))
                                return DISCONNECTED;
@@ -183,7 +183,9 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
        {
                /* New server is being introduced to the network */
 
-               if( Req->argc != 4 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+               if (Req->argc != 4)
+                       return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+                                                 Client_ID(Client), Req->command);
 
                /* check for existing server with same ID */
                if( ! Client_CheckID( Client, Req->argv[0] )) return DISCONNECTED;
@@ -213,7 +215,7 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
 
                return CONNECTED;
        } else
-               return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+               return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
                                          Client_ID(Client), Req->command);
 } /* IRC_SERVER */
 
@@ -336,7 +338,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
        } else
                from = Client;
        if (!from)
-               return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
+               return IRC_WriteErrClient(Client, ERR_NOSUCHNICK_MSG,
                                          Client_ID(Client), Req->prefix);
 
        if (Client_Type(Client) == CLIENT_USER)