comparison mcabber/src/roster.c @ 1504:9fafea381eb8

Show the number of unfiltered contacts in folded groups
author franky
date Sun, 31 Aug 2008 11:29:04 +0200
parents 77afd831f8f7
children b29ac1f171ea
comparison
equal deleted inserted replaced
1503:c74cfe7fd848 1504:9fafea381eb8
811 int buddylist_isset_filter(void) 811 int buddylist_isset_filter(void)
812 { 812 {
813 return (display_filter != DFILTER_ALL); 813 return (display_filter != DFILTER_ALL);
814 } 814 }
815 815
816 int buddylist_is_status_filtered(enum imstatus status)
817 {
818 return display_filter & (1 << status);
819 }
820
816 void buddylist_set_filter(guchar filter) 821 void buddylist_set_filter(guchar filter)
817 { 822 {
818 display_filter = filter; 823 display_filter = filter;
819 } 824 }
820 825
867 // - buddy has a lock (for example the buddy window is currently open) 872 // - buddy has a lock (for example the buddy window is currently open)
868 // - buddy has a pending (non-read) message 873 // - buddy has a pending (non-read) message
869 // - group isn't hidden (shrunk) 874 // - group isn't hidden (shrunk)
870 // - this is the current_buddy 875 // - this is the current_buddy
871 if (roster_usrelt == roster_current_buddy || 876 if (roster_usrelt == roster_current_buddy ||
872 display_filter & 1<<buddy_getstatus((gpointer)roster_usrelt, NULL) || 877 buddylist_is_status_filtered(buddy_getstatus((gpointer)roster_usrelt,
878 NULL)) ||
873 (buddy_getflags((gpointer)roster_usrelt) & 879 (buddy_getflags((gpointer)roster_usrelt) &
874 (ROSTER_FLAG_LOCK | ROSTER_FLAG_USRLOCK | ROSTER_FLAG_MSG))) { 880 (ROSTER_FLAG_LOCK | ROSTER_FLAG_USRLOCK | ROSTER_FLAG_MSG))) {
875 // This user should be added. Maybe the group hasn't been added yet? 881 // This user should be added. Maybe the group hasn't been added yet?
876 if (pending_group) { 882 if (pending_group) {
877 // It hasn't been done yet 883 // It hasn't been done yet