summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-18 22:27:58 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-18 22:27:58 +0000
commitedf0e479b5cb874f72223f3056a31b8913b0850a (patch)
tree4069f86eb08accdc1fcb88e62c0b56297caea6ac /src
parent18bc86bfe7a6136f93d73734ba9c7a4a38aa6b83 (diff)
downloadirssi-edf0e479b5cb874f72223f3056a31b8913b0850a.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/core/fe-channels.c8
-rw-r--r--src/fe-common/core/module-formats.c3
-rw-r--r--src/fe-common/core/module-formats.h3
3 files changed, 12 insertions, 2 deletions
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,