Mercurial > ~mikael > mcabber > hg
diff mcabber/src/screen.c @ 1504:9fafea381eb8
Show the number of unfiltered contacts in folded groups
author | franky |
---|---|
date | Sun, 31 Aug 2008 11:29:04 +0200 |
parents | c74cfe7fd848 |
children | 78137e986528 |
line wrap: on
line diff
--- a/mcabber/src/screen.c Sat Aug 23 21:01:14 2008 +0200 +++ b/mcabber/src/screen.c Sun Aug 31 11:29:04 2008 +0200 @@ -1726,6 +1726,13 @@ } } +void increment_if_buddy_not_filtered(gpointer rosterdata, void *param) +{ + int *p = param; + if (buddylist_is_status_filtered(buddy_getstatus(rosterdata, NULL))) + *p=*p+1; +} + // scr_DrawRoster() // Display the buddylist (not really the roster) on the screen void scr_DrawRoster(void) @@ -1889,12 +1896,15 @@ name[0] = 0; if (isgrp) { - char *sep; - if (ishid) - sep = "+++"; + if (ishid){ + int group_count = 0; + foreach_group_member(BUDDATA(buddy), increment_if_buddy_not_filtered, + &group_count); + snprintf(rline, 4*Roster_Width, " %c+++ %s (%i)", pending, name, + group_count); + } else - sep = "---"; - snprintf(rline, 4*Roster_Width, " %c%s %s", pending, sep, name); + snprintf(rline, 4*Roster_Width, " %c--- %s", pending, name); } else if (isspe) { snprintf(rline, 4*Roster_Width, " %c%s", pending, name); } else {