core: fix bug with option weechat.look.hotlist_count_max when count_max is greater than 1 and priority in hotlist is highlight

This commit is contained in:
Sebastien Helleu 2011-06-21 16:17:32 +02:00
parent 76a39cb0cd
commit d47be1f303

View File

@ -1037,7 +1037,7 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
{
char buf[2048], format[32], *buffer_without_name_displayed;
struct t_gui_hotlist *ptr_hotlist;
int numbers_count, names_count, display_name;
int numbers_count, names_count, display_name, count_max;
int priority, priority_min, priority_min_displayed, private;
/* make C compiler happy */
@ -1154,7 +1154,17 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
{
private = (ptr_hotlist->count[GUI_HOTLIST_PRIVATE] > 0) ? 1 : 0;
priority_min_displayed = ptr_hotlist->priority + 1;
priority_min = ptr_hotlist->priority - CONFIG_INTEGER(config_look_hotlist_count_max) + 1;
count_max = CONFIG_INTEGER(config_look_hotlist_count_max);
if (!private
&& (ptr_hotlist->priority == GUI_HOTLIST_HIGHLIGHT)
&& (count_max > 1))
{
priority_min = ptr_hotlist->priority - count_max;
}
else
{
priority_min = ptr_hotlist->priority - count_max + 1;
}
if (priority_min < 0)
priority_min = 0;
for (priority = ptr_hotlist->priority;