diff options
author | Timo Sirainen <cras@irssi.org> | 2002-01-20 12:21:18 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2002-01-20 12:21:18 +0000 |
commit | c55bac3a0900103c9d788444d21e3c314e8b9f5d (patch) | |
tree | a948c57862dd7ab159648f001237603c8924d97b /src/irc | |
parent | c8a58bffad71eb4a6032b5dd96699dabde559b56 (diff) | |
download | irssi-c55bac3a0900103c9d788444d21e3c314e8b9f5d.zip |
We now handle PINGs from client properly.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2328 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/proxy/listen.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/irc/proxy/listen.c b/src/irc/proxy/listen.c index 934add17..750adf7a 100644 --- a/src/irc/proxy/listen.c +++ b/src/irc/proxy/listen.c @@ -132,24 +132,17 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args, remove_client(client); return; } if (strcmp(cmd, "PING") == 0) { - /* Reply to PING, if the server parameter is either + /* Reply to PING, if the target parameter is either proxy_adress, our own nick or empty. */ - char *params, *server1, *server2, *server; - - params = event_get_params(args, 2, &server1, &server2); - server = *server2 != '\0' ? server2 : server1; - 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; - else if (server == server2) { - /* <data> <server> - reply only with <data> */ - args = server1; - } - proxy_outdata(client, ":%s PONG %s :%s\n", client->proxy_address, client->proxy_address, args); + char *params, *origin, *target; + + params = event_get_params(args, 2, &origin, &target); + if (*target == '\0' || + g_strcasecmp(target, client->proxy_address) == 0 || + g_strcasecmp(target, client->nick) == 0) { + proxy_outdata(client, ":%s PONG %s :%s\n", + client->proxy_address, + client->proxy_address, origin); g_free(params); return; } |