1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

(zZzZ) wasn't displayed in statusbar if you didn't have any user mode set.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@426 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-07-04 19:03:57 +00:00 committed by cras
parent 6c9655a513
commit e4a63db280

View File

@ -132,20 +132,17 @@ static void statusbar_nick(SBAR_ITEM_REC *item, int ypos)
NICK_REC *nickrec;
int size_needed;
int umode_size;
gchar nick[10];
char nick[10];
server = (IRC_SERVER_REC *) (active_win == NULL ? NULL : active_win->active_server);
umode_size = server == NULL || server->usermode == NULL ? 0 : strlen(server->usermode)+3;
/* nick */
if (server == NULL || server->nick == NULL)
{
if (server == NULL || server->nick == NULL) {
nick[0] = '\0';
nickrec = NULL;
}
else
{
} else {
strncpy(nick, server->nick, 9);
nick[9] = '\0';
@ -157,8 +154,7 @@ static void statusbar_nick(SBAR_ITEM_REC *item, int ypos)
(server != NULL && server->usermode_away ? 7 : 0) +
(nickrec != NULL && (nickrec->op || nickrec->voice) ? 1 : 0); /* @ + */
if (item->size != size_needed)
{
if (item->size != size_needed) {
/* we need more (or less..) space! */
statusbar_item_resize(item, size_needed);
return;
@ -169,23 +165,19 @@ static void statusbar_nick(SBAR_ITEM_REC *item, int ypos)
set_color((1 << 4)+3); addch('[');
if (nickrec != NULL && (nickrec->op || nickrec->voice))
{
set_color((1 << 4)+15); addch(nickrec->op ? '@' : '+');
}
set_color((1 << 4)+7); addstr(nick);
if (umode_size)
{
if (umode_size) {
set_color((1 << 4)+15); addch('(');
set_color((1 << 4)+3); addch('+');
set_color((1 << 4)+7); addstr(server->usermode);
set_color((1 << 4)+15); addch(')');
if (server->usermode_away)
{
}
if (server->usermode_away) {
set_color((1 << 4)+7); addstr(" (");
set_color((1 << 4)+10); addstr("zZzZ");
set_color((1 << 4)+7); addch(')');
}
}
set_color((1 << 4)+3); addch(']');
screen_refresh();
}