Mercurial > pidgin
changeset 1393:3b5c7f8bb2b5
[gaim-migrate @ 1403]
I'm lame. Oh well, at least pings tell how many seconds they took.
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Mon, 08 Jan 2001 06:42:03 +0000 |
parents | dc6ba774bfc5 |
children | a2fa5a9977e0 |
files | plugins/irc.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/irc.c Sun Jan 07 20:39:03 2001 +0000 +++ b/plugins/irc.c Mon Jan 08 06:42:03 2001 +0000 @@ -725,6 +725,10 @@ /* Someone's triyng to ping us. Let's respond */ gchar u_arg[24]; gchar u_buf[200]; + unsigned long tend= time((time_t *)NULL); + unsigned long tstart; + + printf("LA: %s\n", buf); strcpy(u_arg, u_message + 6); u_arg[strlen(u_arg) - 1] = '\0'; @@ -733,7 +737,9 @@ * the serial # and the time so that we can accurately report which * pings are turning, etc */ - g_snprintf(u_buf, sizeof(u_buf), "Ping Reply From %s", u_nick); + tstart = atol(u_arg); + + g_snprintf(u_buf, sizeof(u_buf), "Ping Reply From %s: [%ld seconds]", u_nick, tend-tstart); do_error_dialog(u_buf, "Gaim IRC - Ping Reply"); @@ -1089,9 +1095,8 @@ struct gaim_connection *gc = (struct gaim_connection *)gtk_object_get_user_data(w); struct irc_data *idata = (struct irc_data *)gc->proto_data; char buf[BUF_LEN]; - unsigned int serial = 2391271; - g_snprintf(buf, BUF_LEN, "PRIVMSG %s :%cPING %d%c\n", who, '\001', serial, '\001'); + g_snprintf(buf, BUF_LEN, "PRIVMSG %s :%cPING %ld%c\n", who, '\001', time((time_t *)NULL), '\001'); write(idata->fd, buf, strlen(buf)); }