]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-server.c
Streamline punctuation of log messages
[ngircd-alex.git] / src / ngircd / irc-server.c
index 79facf5e0ead3a639c475956cc1a34a46aa1d4fc..0a9e930d816f696b5fc784fa6857c063fbf49744 100644 (file)
@@ -104,6 +104,10 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                if (!Client_CheckID(Client, Req->argv[0]))
                        return DISCONNECTED;
 
+               /* Mark this connection as belonging to an configured server */
+               if (!Conf_SetServer(i, Client_Conn(Client)))
+                       return DISCONNECTED;
+
                Client_SetID( Client, Req->argv[0] );
                Client_SetHops( Client, 1 );
                Client_SetInfo( Client, Req->argv[Req->argc - 1] );
@@ -131,14 +135,11 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req )
                        Client_SetToken(Client, atoi(Req->argv[1]));
                }
 
-               /* Mark this connection as belonging to an configured server */
-               Conf_SetServer(i, Client_Conn(Client));
-
                /* Check protocol level */
                if (Client_Type(Client) == CLIENT_GOTPASS) {
                        /* We got a "simple" PASS command, so the peer is
                         * using the protocol as defined in RFC 1459. */
-                       if (!Conn_Options(Client_Conn(Client)) & CONN_RFC1459)
+                       if (! (Conn_Options(Client_Conn(Client)) & CONN_RFC1459))
                                Log(LOG_INFO,
                                    "Switching connection %d (\"%s\") to RFC 1459 compatibility mode.",
                                    Client_Conn(Client), Client_ID(Client));
@@ -351,7 +352,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
 
        if (Req->argv[1][0])
                if (Client_NextHop(from) != Client || con > NONE)
-                       snprintf(msg, sizeof(msg), "%s (SQUIT from %s)",
+                       snprintf(msg, sizeof(msg), "\"%s\" (SQUIT from %s)",
                                 Req->argv[1], Client_ID(from));
                else
                        strlcpy(msg, Req->argv[1], sizeof(msg));
@@ -384,7 +385,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
                        logmsg[0] = '\0';
                        if (!strchr(msg, '('))
                                snprintf(logmsg, sizeof(logmsg),
-                                        "%s (SQUIT from %s)", Req->argv[1],
+                                        "\"%s\" (SQUIT from %s)", Req->argv[1],
                                         Client_ID(from));
                        Client_Destroy(target, logmsg[0] ? logmsg : msg,
                                       msg, false);