From 93061dd48fca1b85ddcca611502435c068d0a1d8 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 20 Jan 2002 14:03:14 +0000 Subject: [PATCH] Handle PING requests now properly. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2330 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/irc-servers.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index ef8a21ee..fe3e5fcc 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -513,13 +513,14 @@ static void event_error(IRC_SERVER_REC *server, const char *data) static void event_ping(IRC_SERVER_REC *server, const char *data) { - char *str; + char *params, *origin, *target, *str; - g_return_if_fail(data != NULL); - - str = g_strdup_printf("PONG %s", data); + params = event_get_params(data, 2, &origin, &target); + str = *target == '\0' ? g_strconcat("PONG :", origin, NULL) : + g_strdup_printf("PONG %s :%s", target, origin); irc_send_cmd_now(server, str); - g_free(str); + g_free(str); + g_free(params); } static void event_empty(void)