diff options
author | Timo Sirainen <cras@irssi.org> | 2000-09-25 19:01:40 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-09-25 19:01:40 +0000 |
commit | c23403d95e9115f25d8835346d9d65061cfb76b5 (patch) | |
tree | 5d43729d991c58b5c3678a22a57d64856b4e7b1e | |
parent | 45577f621c2e05882d90bf7d59a5f691b2260f77 (diff) | |
download | irssi-c23403d95e9115f25d8835346d9d65061cfb76b5.zip |
Display CTCP PING replies even if they're not in the form irssi
expected.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@671 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/fe-common/irc/fe-ctcp.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/fe-common/irc/fe-ctcp.c b/src/fe-common/irc/fe-ctcp.c index e2b3e4ed..1c2ed843 100644 --- a/src/fe-common/irc/fe-ctcp.c +++ b/src/fe-common/irc/fe-ctcp.c @@ -65,7 +65,9 @@ static void ctcp_time_msg(const char *data, IRC_SERVER_REC *server, const char * ctcp_print("CTCP TIME", data, server, nick, addr, target); } -static void ctcp_default_reply(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target) +static void ctcp_default_reply(const char *data, IRC_SERVER_REC *server, + const char *nick, const char *addr, + const char *target) { const char *ctcpdata; char *ctcp, *ptr; @@ -86,15 +88,21 @@ static void ctcp_default_reply(const char *data, IRC_SERVER_REC *server, const c g_free(ctcp); } -static void ctcp_ping_reply(const char *data, IRC_SERVER_REC *server, const char *nick, const char *addr, const char *target) +static void ctcp_ping_reply(const char *data, IRC_SERVER_REC *server, + const char *nick, const char *addr, + const char *target) { GTimeVal tv, tv2; long usecs; g_return_if_fail(data != NULL); - if (sscanf(data, "%ld %ld", &tv2.tv_sec, &tv2.tv_usec) != 2) + if (sscanf(data, "%ld %ld", &tv2.tv_sec, &tv2.tv_usec) != 2) { + char *tmp = g_strconcat("PING ", data, NULL); + ctcp_default_reply(tmp, server, nick, addr, target); + g_free(tmp); return; + } g_get_current_time(&tv); usecs = get_timeval_diff(&tv, &tv2); |