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

Setting lag_min_show to -1 disables displaying lag entirely.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@390 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-06-28 21:06:17 +00:00 committed by cras
parent d4f8ad2c3f
commit dc22d8830d

View File

@ -527,7 +527,7 @@ static void statusbar_lag(SBAR_ITEM_REC *item, int ypos)
lag_unknown = now-server->lag_last_check >
MAX_LAG_UNKNOWN_TIME+settings_get_int("lag_check_time");
if (server->lag < lag_min_show && !lag_unknown)
if (lag_min_show < 0 || (server->lag < lag_min_show && !lag_unknown))
size_needed = 0; /* small lag, don't display */
else {
g_string_sprintf(str, "%d.%02d", server->lag/1000, (server->lag % 1000)/10);
@ -541,27 +541,25 @@ static void statusbar_lag(SBAR_ITEM_REC *item, int ypos)
size_needed = str->len+7;
}
if (item->size != size_needed)
{
/* we need more (or less..) space! */
statusbar_item_resize(item, size_needed);
g_string_free(str, TRUE);
return;
}
if (item->size != size_needed) {
/* we need more (or less..) space! */
statusbar_item_resize(item, size_needed);
g_string_free(str, TRUE);
return;
}
if (item->size != 0)
{
lag_last_draw = now;
move(ypos, item->xpos);
set_color((1 << 4)+3); addch('[');
set_color((1 << 4)+7); addstr("Lag: ");
if (item->size != 0) {
lag_last_draw = now;
move(ypos, item->xpos);
set_color((1 << 4)+3); addch('[');
set_color((1 << 4)+7); addstr("Lag: ");
set_color((1 << 4)+15); addstr(str->str);
set_color((1 << 4)+3); addch(']');
set_color((1 << 4)+15); addstr(str->str);
set_color((1 << 4)+3); addch(']');
screen_refresh();
}
g_string_free(str, TRUE);
screen_refresh();
}
g_string_free(str, TRUE);
}
static void sig_statusbar_lag_redraw(void)