From edf0e479b5cb874f72223f3056a31b8913b0850a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 18 Nov 2001 22:27:58 +0000 Subject: [PATCH] Added new formats for ops/halfops/voices in /NAMES list. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2067 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- default.theme | 3 +++ src/fe-common/core/fe-channels.c | 8 ++++++-- src/fe-common/core/module-formats.c | 3 +++ src/fe-common/core/module-formats.h | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/default.theme b/default.theme index 43d82044..f4de16c6 100644 --- a/default.theme +++ b/default.theme @@ -218,6 +218,9 @@ abstracts = { # /names list names_nick = "[%_$0%_$1-] "; + names_nick_op = "{names_nick $*}"; + names_nick_halfop = "{names_nick $*}"; + names_nick_voice = "{names_nick $*}"; names_users = "[%g$*%n]"; names_channel = "%G$*%n"; diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 6e48ab52..b430c3f6 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -332,7 +332,7 @@ static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist) char *format, *stripped; char *linebuf, nickmode[2] = { 0, 0 }; int *columns, cols, rows, last_col_rows, col, row, max_width; - int item_extra, linebuf_size; + int item_extra, linebuf_size, formatnum; window = window_find_closest(channel->server, channel->name, MSGLEVEL_CLIENTCRAP); @@ -390,9 +390,13 @@ static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist) linebuf[columns[col]-item_extra] = '\0'; memcpy(linebuf, rec->nick, strlen(rec->nick)); + formatnum = rec->op ? TXT_NAMES_NICK_OP : + rec->halfop ? TXT_NAMES_NICK_HALFOP : + rec->voice ? TXT_NAMES_NICK_VOICE : + TXT_NAMES_NICK; format = format_get_text(MODULE_NAME, NULL, channel->server, channel->name, - TXT_NAMES_NICK, nickmode, linebuf); + formatnum, nickmode, linebuf); g_string_append(str, format); g_free(format); diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index ee34e495..480c705c 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -102,6 +102,9 @@ FORMAT_REC fecommon_core_formats[] = { { "not_in_channels", "You are not on any channels", 0 }, { "current_channel", "Current channel {channel $0}", 1, { 0 } }, { "names", "{names_users Users {names_channel $0}} $1", 2, { 0, 0 } }, + { "names_nick_op", "{names_nick_op $0 $1}", 2, { 0, 0 } }, + { "names_nick_halfop", "{names_nick_halfop $0 $1}", 2, { 0, 0 } }, + { "names_nick_voice", "{names_nick_voice $0 $1}", 2, { 0, 0 } }, { "names_nick", "{names_nick $0 $1}", 2, { 0, 0 } }, { "endofnames", "{channel $0}: Total of {hilight $1} nicks {comment {hilight $2} ops, {hilight $3} voices, {hilight $4} normal}", 5, { 0, 1, 1, 1, 1 } }, { "chanlist_header", "You are on the following channels:", 0 }, diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h index a6156069..db07b2f8 100644 --- a/src/fe-common/core/module-formats.h +++ b/src/fe-common/core/module-formats.h @@ -78,6 +78,9 @@ enum { TXT_NOT_IN_CHANNELS, TXT_CURRENT_CHANNEL, TXT_NAMES, + TXT_NAMES_NICK_OP, + TXT_NAMES_NICK_HALFOP, + TXT_NAMES_NICK_VOICE, TXT_NAMES_NICK, TXT_ENDOFNAMES, TXT_CHANLIST_HEADER,