diff options
author | Timo Sirainen <cras@irssi.org> | 2001-11-18 12:35:19 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-11-18 12:35:19 +0000 |
commit | 100d92dff02437d39d3593795e8a0db0aed82917 (patch) | |
tree | 29d245684e03629791f2c9f606fbe9dd257e34aa /src/irc | |
parent | 5802ec5a34f4bd342fdf18a13983a73c2ea06d00 (diff) | |
download | irssi-100d92dff02437d39d3593795e8a0db0aed82917.zip |
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
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/proxy/listen.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c index e30cc9ba..7874ed60 100644 --- a/src/irc/proxy/listen.c +++ b/src/irc/proxy/listen.c @@ -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) { |