From 7d7b5e380e1e1e56743048078a03ac6f55198d73 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 19 Oct 2001 11:59:27 +0000 Subject: [PATCH] /LASTLOG -count option added. patch by dgl@dgl.cx git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1850 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/lastlog.c | 11 +++++++++-- src/fe-text/module-formats.c | 1 + src/fe-text/module-formats.h | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/fe-text/lastlog.c b/src/fe-text/lastlog.c index e854fd9b..1602fdad 100644 --- a/src/fe-text/lastlog.c +++ b/src/fe-text/lastlog.c @@ -154,6 +154,13 @@ static void show_lastlog(const char *searchtext, GHashTable *optlist, len = g_list_length(tmp); } + if(g_hash_table_lookup(optlist, "count") != NULL) { + printformat_window(active_win, MSGLEVEL_CLIENTNOTICE, + TXT_LASTLOG_COUNT, len); + g_list_free(list); + return; + } + if (len > MAX_LINES_WITHOUT_FORCE && fhandle == -1 && g_hash_table_lookup(optlist, "force") == NULL) { printformat_window(active_win, MSGLEVEL_CLIENTNOTICE, @@ -206,7 +213,7 @@ static void show_lastlog(const char *searchtext, GHashTable *optlist, } /* SYNTAX: LASTLOG [-] [-file ] [-clear] [- -] - [-new | -away] [-regexp | -word] [-case] + [-count] [-new | -away] [-regexp | -word] [-case] [-window ] [] [ []] */ static void cmd_lastlog(const char *data) { @@ -256,7 +263,7 @@ void lastlog_init(void) { command_bind("lastlog", NULL, (SIGNAL_FUNC) cmd_lastlog); - command_set_options("lastlog", "!- force clear -file -window new away word regexp case"); + command_set_options("lastlog", "!- force clear -file -window new away word regexp case count"); } void lastlog_deinit(void) diff --git a/src/fe-text/module-formats.c b/src/fe-text/module-formats.c index 928d569a..afae7e79 100644 --- a/src/fe-text/module-formats.c +++ b/src/fe-text/module-formats.c @@ -26,6 +26,7 @@ FORMAT_REC gui_text_formats[] = { MODULE_NAME, "Text user interface", 0 }, { "lastlog_too_long", "/LASTLOG would print $0 lines. If you really want to print all these lines use -force option.", 1, { 1 } }, + { "lastlog_count", "{hilight Lastlog}: $0 lines", 1, { 1 } }, { "lastlog_start", "{hilight Lastlog}:", 0 }, { "lastlog_end", "{hilight End of Lastlog}", 0 }, diff --git a/src/fe-text/module-formats.h b/src/fe-text/module-formats.h index e1f6e31f..eb8f3dff 100644 --- a/src/fe-text/module-formats.h +++ b/src/fe-text/module-formats.h @@ -4,6 +4,7 @@ enum { TXT_MODULE_NAME, TXT_LASTLOG_TOO_LONG, + TXT_LASTLOG_COUNT, TXT_LASTLOG_START, TXT_LASTLOG_END,