1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Reply to PINGs ourself if destination was proxy's address, our own nick or

no destination at all.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2048 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-11-18 12:35:19 +00:00 committed by cras
parent 5802ec5a34
commit 100d92dff0

View File

@ -126,6 +126,21 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
if (strcmp(cmd, "QUIT") == 0) {
remove_client(client);
return;
} if (strcmp(cmd, "PING") == 0) {
/* Reply to PING, if the parameter is either proxy_adress,
our own nick or empty. */
char *server = args;
if (*server == ':') server++;
if (*server == '\0' ||
g_strncasecmp(server, client->proxy_address,
strlen(client->proxy_address)) == 0 ||
g_strncasecmp(server, client->nick,
strlen(client->nick)) == 0) {
if (*server == '\0') args = client->nick;
proxy_outdata(client, ":%s PONG %s\n", client->proxy_address, args);
return;
}
}
if (client->server == NULL || !client->server->connected) {