1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

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
This commit is contained in:
Timo Sirainen 2001-11-18 22:27:58 +00:00 committed by cras
parent 18bc86bfe7
commit edf0e479b5
4 changed files with 15 additions and 2 deletions

View File

@ -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";

View File

@ -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);

View File

@ -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 },

View File

@ -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,