diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-10-28 19:32:57 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-10-28 19:32:57 +0200 |
commit | 5e5a926e99444b73232ad9bd1e611433fb255cef (patch) | |
tree | 6ed44065e8db5717ede472708db9b55e9044482a /src/gui/gui-nicklist.c | |
parent | 90f06b348e8b0ec5c82474df536f85d659248ba4 (diff) | |
download | weechat-5e5a926e99444b73232ad9bd1e611433fb255cef.zip |
Fix bug when counting number of groups/nicks displayed in nicklist
Diffstat (limited to 'src/gui/gui-nicklist.c')
-rw-r--r-- | src/gui/gui-nicklist.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gui/gui-nicklist.c b/src/gui/gui-nicklist.c index 5ed2788b6..8f314785c 100644 --- a/src/gui/gui-nicklist.c +++ b/src/gui/gui-nicklist.c @@ -651,23 +651,36 @@ gui_nicklist_get_max_length (struct t_gui_buffer *buffer, } /* - * gui_nicklist_compute_visible_count: compute visible_count variable for a buffer + * gui_nicklist_compute_visible_count: compute visible_count variable for a + * buffer */ void gui_nicklist_compute_visible_count (struct t_gui_buffer *buffer, struct t_gui_nick_group *group) { + struct t_gui_nick_group *ptr_group; + struct t_gui_nick *ptr_nick; + if (!buffer || !group) return; /* count for childs */ - if (group->childs) - gui_nicklist_compute_visible_count (buffer, group->childs); + for (ptr_group = group->childs; ptr_group; + ptr_group = ptr_group->next_group) + { + gui_nicklist_compute_visible_count (buffer, ptr_group); + } /* count current group */ if (buffer->nicklist_display_groups && group->visible) buffer->nicklist_visible_count++; + + /* count nicks in group */ + for (ptr_nick = group->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick) + { + buffer->nicklist_visible_count++; + } } /* |