diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c index f5cf2208..42dec0aa 100644 --- a/src/fe-common/irc/fe-events-numeric.c +++ b/src/fe-common/irc/fe-events-numeric.c @@ -28,6 +28,7 @@ #include "irc-servers.h" #include "irc-channels.h" #include "nicklist.h" +#include "mode-lists.h" #include "../core/module-formats.h" #include "printtext.h" @@ -133,6 +134,8 @@ static void event_end_of_who(IRC_SERVER_REC *server, const char *data) static void event_ban_list(IRC_SERVER_REC *server, const char *data) { + IRC_CHANNEL_REC *chanrec; + BAN_REC *banrec; const char *channel; char *params, *ban, *setby, *tims; long secs; @@ -144,10 +147,14 @@ static void event_ban_list(IRC_SERVER_REC *server, const char *data) secs = *tims == '\0' ? 0 : (long) (time(NULL) - atol(tims)); + chanrec = irc_channel_find(server, channel); + banrec = chanrec == NULL ? NULL : banlist_find(chanrec->banlist, ban); + channel = get_visible_target(server, channel); printformat(server, channel, MSGLEVEL_CRAP, *setby == '\0' ? IRCTXT_BANLIST : IRCTXT_BANLIST_LONG, - 0, channel, ban, setby, secs); + banrec == NULL ? 0 : g_slist_index(chanrec->banlist, banrec)+1, + channel, ban, setby, secs); g_free(params); } diff --git a/src/irc/core/mode-lists.c b/src/irc/core/mode-lists.c index d7fef183..9d85e133 100644 --- a/src/irc/core/mode-lists.c +++ b/src/irc/core/mode-lists.c @@ -44,7 +44,7 @@ void banlist_free(GSList *banlist) ban_free(&banlist, banlist->data); } -static BAN_REC *banlist_find(GSList *list, const char *ban) +BAN_REC *banlist_find(GSList *list, const char *ban) { GSList *tmp; diff --git a/src/irc/core/mode-lists.h b/src/irc/core/mode-lists.h index 324b7752..105e1245 100644 --- a/src/irc/core/mode-lists.h +++ b/src/irc/core/mode-lists.h @@ -7,6 +7,8 @@ typedef struct { time_t time; } BAN_REC; +BAN_REC *banlist_find(GSList *list, const char *ban); + BAN_REC *banlist_add(IRC_CHANNEL_REC *channel, const char *ban, const char *nick, time_t time); void banlist_remove(IRC_CHANNEL_REC *channel, const char *ban);