comparison src/blist.c @ 12112:875f59f9c0bb

[gaim-migrate @ 14412] A better interface for iterating the buddy list from none other than Sadrul committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 16 Nov 2005 08:27:17 +0000
parents d0662345799b
children 1504d878be54
comparison
equal deleted inserted replaced
12111:b528f37d8e95 12112:875f59f9c0bb
708 708
709 if (ops && ops->set_visible) 709 if (ops && ops->set_visible)
710 ops->set_visible(gaimbuddylist, show); 710 ops->set_visible(gaimbuddylist, show);
711 } 711 }
712 712
713 static GaimBlistNode *get_next_node(GaimBlistNode *node, gboolean godeep)
714 {
715 if (node == NULL)
716 return NULL;
717
718 if (godeep && node->child)
719 return node->child;
720
721 if (node->next)
722 return node->next;
723
724 return get_next_node(node->parent, FALSE);
725 }
726
727 GaimBlistNode *gaim_blist_node_next(GaimBlistNode *node, gboolean offline)
728 {
729 GaimBlistNode *ret = node;
730
731 do
732 {
733 ret = get_next_node(ret, TRUE);
734 } while (ret && !offline && GAIM_BLIST_NODE_IS_BUDDY(ret) &&
735 !gaim_account_is_connected(gaim_buddy_get_account((GaimBuddy *)ret)));
736
737 return ret;
738 }
739
713 void 740 void
714 gaim_blist_update_buddy_status(GaimBuddy *buddy, GaimStatus *old_status) 741 gaim_blist_update_buddy_status(GaimBuddy *buddy, GaimStatus *old_status)
715 { 742 {
716 GaimBlistUiOps *ops = gaimbuddylist->ui_ops; 743 GaimBlistUiOps *ops = gaimbuddylist->ui_ops;
717 GaimPresence *presence; 744 GaimPresence *presence;