summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-20 14:03:14 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-20 14:03:14 +0000
commit93061dd48fca1b85ddcca611502435c068d0a1d8 (patch)
tree7ed085f97b5fee28b9390e5b6fe8d44f754a4b43 /src/irc
parent117f27eb923c54bfc468e0e3ca61c4c403784544 (diff)
downloadirssi-93061dd48fca1b85ddcca611502435c068d0a1d8.zip
Handle PING requests now properly.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2330 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-servers.c11
1 files 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;
-
- g_return_if_fail(data != NULL);
+ char *params, *origin, *target, *str;
- 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)