diff options
author | Timo Sirainen <cras@irssi.org> | 2001-12-09 17:13:48 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-12-09 17:13:48 +0000 |
commit | 15e815e8d3ff84683c2429f59738f6625d3e4f9b (patch) | |
tree | d09ad892780db823466c9a36b102fe2de3882154 /src/fe-common/core | |
parent | a8419ed5b93af2c063ca90a4f34ffe36d88458a2 (diff) | |
download | irssi-15e815e8d3ff84683c2429f59738f6625d3e4f9b.zip |
Better support for halfops, patch by yathen@web.de
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2228 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/fe-channels.c | 18 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.c | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/fe-common/core/fe-channels.c b/src/fe-common/core/fe-channels.c index 3813534b..0b82df64 100644 --- a/src/fe-common/core/fe-channels.c +++ b/src/fe-common/core/fe-channels.c @@ -390,8 +390,15 @@ static void display_sorted_nicks(CHANNEL_REC *channel, GSList *nicklist) for (tmp = nicklist; tmp != NULL; tmp = tmp->next) { NICK_REC *rec = tmp->data; - nickmode[0] = rec->op ? '@' : rec->voice ? '+' : ' '; - + if (rec->op) + nickmode[0] = '@'; + else if (rec->halfop) + nickmode[0] = '%'; + else if (rec->voice) + nickmode[0] = '+'; + else + nickmode[0] = ' '; + if (linebuf_size < columns[col]-item_extra+1) { linebuf_size = (columns[col]-item_extra+1)*2; linebuf = g_realloc(linebuf, linebuf_size); @@ -439,9 +446,9 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags) { NICK_REC *nick; GSList *tmp, *nicklist, *sorted; - int nicks, normal, voices, ops; + int nicks, normal, voices, halfops, ops; - nicks = normal = voices = ops = 0; + nicks = normal = voices = halfops = ops = 0; nicklist = nicklist_getnicks(channel); sorted = NULL; @@ -455,6 +462,7 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags) if ((flags & CHANNEL_NICKLIST_FLAG_OPS) == 0) continue; } else if (nick->halfop) { + halfops++; if ((flags & CHANNEL_NICKLIST_FLAG_HALFOPS) == 0) continue; } else if (nick->voice) { @@ -482,7 +490,7 @@ void fe_channels_nicklist(CHANNEL_REC *channel, int flags) printformat(channel->server, channel->name, MSGLEVEL_CRAP, TXT_ENDOFNAMES, - channel->name, nicks, ops, voices, normal); + channel->name, nicks, ops, halfops, voices, normal); } /* SYNTAX: NAMES [-count | -ops -halfops -voices -normal] [<channels> | **] */ diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index 2f6a1d30..79fd7bdc 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -108,7 +108,7 @@ FORMAT_REC fecommon_core_formats[] = { { "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 } }, + { "endofnames", "{channel $0}: Total of {hilight $1} nicks {comment {hilight $2} ops, {hilight $3} halfops, {hilight $4} voices, {hilight $5} normal}", 6, { 0, 1, 1, 1, 1, 1 } }, { "chanlist_header", "You are on the following channels:", 0 }, { "chanlist_line", "{channel $[-10]0} %|+$1 ($2): $3", 4, { 0, 0, 0, 0 } }, { "chansetup_not_found", "Channel {channel $0} not found", 2, { 0, 0 } }, |