From 4e2fcc71ae8c699c07af760dff73d29e0aaf89ce Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 20 Feb 2008 20:28:07 +0000 Subject: [PATCH] Show setter/time in +I lists, if sent by the server. Code mostly copied from +e. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4716 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-events-numeric.c | 12 +++++++++--- src/fe-common/irc/module-formats.c | 1 + src/fe-common/irc/module-formats.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index 40d05a75..0510c4ff 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -210,14 +210,20 @@ static void event_accept_list(IRC_SERVER_REC *server, const char *data) static void event_invite_list(IRC_SERVER_REC *server, const char *data) { const char *channel; - char *params, *invite; + char *params, *invite, *setby, *tims; + long secs; g_return_if_fail(data != NULL); - params = event_get_params(data, 3, NULL, &channel, &invite); + params = event_get_params(data, 5, NULL, &channel, &invite, + &setby, &tims); + secs = *tims == '\0' ? 0 : + (long) (time(NULL) - atol(tims)); + channel = get_visible_target(server, channel); printformat(server, channel, MSGLEVEL_CRAP, - IRCTXT_INVITELIST, channel, invite); + *setby == '\0' ? IRCTXT_INVITELIST : IRCTXT_INVITELIST_LONG, + channel, invite, setby, secs); g_free(params); } diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c index fb14a0e4..a6cde6fe 100644 --- a/src/fe-common/irc/module-formats.c +++ b/src/fe-common/irc/module-formats.c @@ -74,6 +74,7 @@ FORMAT_REC fecommon_irc_formats[] = { { "ebanlist_long", "{channel $0}: ban exception {ban $1} {comment by {nick $2}, $3 secs ago}", 4, { 0, 0, 0, 1 } }, { "no_invitelist", "Invite list is empty in channel {channel $0}", 1, { 0 } }, { "invitelist", "{channel $0}: invite {ban $1}", 2, { 0, 0 } }, + { "invitelist_long", "{channel $0}: invite {ban $1} {comment by {nick $2}, $3 secs ago}", 4, { 0, 0, 0, 1 } }, { "no_such_channel", "{channel $0}: No such channel", 1, { 0 } }, { "channel_synced", "Join to {channel $0} was synced in {hilight $1} secs", 2, { 0, 2 } }, diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h index d38ce686..34dd3efc 100644 --- a/src/fe-common/irc/module-formats.h +++ b/src/fe-common/irc/module-formats.h @@ -51,6 +51,7 @@ enum { IRCTXT_EBANLIST_LONG, IRCTXT_NO_INVITELIST, IRCTXT_INVITELIST, + IRCTXT_INVITELIST_LONG, IRCTXT_NO_SUCH_CHANNEL, IRCTXT_CHANNEL_SYNCED,