From 919b76fcef7a377e32abe906fe933e48478fcd7f Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Thu, 27 Oct 2016 15:14:57 +1100 Subject: [PATCH] Correctly show time since offer for DCC CHAT offers in /DCC LIST s->time on the SocketList is set to the time that the chat offer will expire, so it's in the future. This shows up as a very large positive time. Instead, use n->lasttime as that is set to the time when the offer is made. Also adjust the format for non-file offers so that it all lines up properly. --- Changelog | 2 ++ source/dcc.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index d1c1eb3..e6d7d1e 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2.2] +* Correctly show time since offer for DCC CHAT offers in /DCC LIST. (caf) + * Improve completion bar for /SET DCC_BAR_TYPE 1 so that it always matches the completion percentage. (caf) diff --git a/source/dcc.c b/source/dcc.c index 655bc3f..a703c2d 100644 --- a/source/dcc.c +++ b/source/dcc.c @@ -2517,7 +2517,7 @@ static const char * const _dcc_offer[] = { void dcc_glist(char *command, char *args) { #define DCC_FORMAT_STAT_PENDING "#$[3]0 $[6]1%Y$2%n $[11]3 $[25]4 $[7]5 $6-" -#define DCC_FORMAT_STAT_CHAT "#$[3]0 $[6]1%Y$2%n $[11]3 $4 $[-4]5 $[-4]6 $[-3]7 $[-3]8 $[7]9 $10" +#define DCC_FORMAT_STAT_CHAT "#$[3]0 $[6]1%Y$2%n $[11]3 $[7]4 $[-4]5 $[-3]6 $[-3]7 $[-3]8 $[7]9 $10" #define DCC_FORMAT_STAT_BARTYPE_0 "#$[3]0 $[6]1%Y$2%n $[11]3 $4 $[7]5 $[7]6 $[7]7 $8-" #define DCC_FORMAT_STAT_BARTYPE_1 "#$[3]0 $[6]1%Y$2%n $[11]3 $[7]5 $[18]6 $[7]7 $8-" int i; @@ -2607,7 +2607,7 @@ void dcc_glist(char *command, char *args) if (((type == DCC_CHAT) || (type == DCC_RAW) || (type == DCC_BOTMODE) || (type == DCC_FTPOPEN))) { if (!(s->flags & DCC_ACTIVE)) - xtime = now - s->time; + xtime = now - n->lasttime.tv_sec; if (do_hook(DCC_STAT_LIST, "%d %s %s %s %s %s %s", n->dccnum, local_type, s->server, dcc_get_state(s),