X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-server.c;h=8526a573ec361b0851222314343e079b447114f6;hp=ca2502dc62414008abdd558a715d458436aa8b2c;hb=343a90dc376eb9979151752ec33c64ca45b04802;hpb=294320ed62bdb7dac546cea43fac3b4c916788a4 diff --git a/src/ngircd/irc-server.c b/src/ngircd/irc-server.c index ca2502dc..8526a573 100644 --- a/src/ngircd/irc-server.c +++ b/src/ngircd/irc-server.c @@ -7,13 +7,15 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. - * - * IRC commands for server links */ - #include "portab.h" +/** + * @file + * IRC commands for server links + */ + #include "imp.h" #include #include @@ -22,12 +24,10 @@ #include #include "defines.h" -#include "resolve.h" #include "conn.h" #include "conn-func.h" #include "conn-zip.h" #include "conf.h" -#include "client.h" #include "channel.h" #include "irc-write.h" #include "lists.h" @@ -80,7 +80,8 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req ) Conn_Close( Client_Conn( Client ), NULL, "Server not configured here", true); return DISCONNECTED; } - if( strcmp( Client_Password( Client ), Conf_Server[i].pwd_in ) != 0 ) + if( strcmp( Conn_Password( Client_Conn( Client ) ), + Conf_Server[i].pwd_in ) != 0 ) { /* wrong password */ Log( LOG_ERR, "Connection %d: Got bad password from server \"%s\"!", Client_Conn( Client ), Req->argv[0] ); @@ -277,6 +278,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) char msg[COMMAND_LEN], logmsg[COMMAND_LEN]; CLIENT *from, *target; CONN_ID con; + int loglevel; assert(Client != NULL); assert(Req != NULL); @@ -301,7 +303,11 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, Client_ID(Client), Req->prefix); - Log(LOG_DEBUG, "Got SQUIT from %s for \"%s\": \"%s\" ...", + if (Client_Type(Client) == CLIENT_USER) + loglevel = LOG_NOTICE | LOG_snotice; + else + loglevel = LOG_DEBUG; + Log(loglevel, "Got SQUIT from %s for \"%s\": \"%s\" ...", Client_ID(from), Req->argv[0], Req->argv[1]); target = Client_Search(Req->argv[0]); @@ -332,6 +338,10 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req) /* We are directly connected to the target server, so we * have to tear down the connection and to inform all the * other remaining servers in the network */ + IRC_SendWallops(Client_ThisServer(), Client_ThisServer(), + "Received SQUIT %s from %s: %s", + Req->argv[0], Client_ID(from), + Req->argv[1][0] ? Req->argv[1] : "-"); Conn_Close(con, NULL, msg, true); if (con == Client_Conn(Client)) return DISCONNECTED;