comparison src/protocols/msn/userlist.c @ 19840:5568b3ac6fce

[gaim-migrate @ 17481] gradually got SOAP contact list and address book from Server. Cache the info in blist.xml committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sat, 14 Oct 2006 20:00:56 +0000
parents ea8b7028e8bb
children
comparison
equal deleted inserted replaced
19839:2b36697b05ea 19840:5568b3ac6fce
716 716
717 msn_userlist_add_buddy(userlist, who, MSN_LIST_FL, new_group_name); 717 msn_userlist_add_buddy(userlist, who, MSN_LIST_FL, new_group_name);
718 msn_userlist_rem_buddy(userlist, who, MSN_LIST_FL, old_group_name); 718 msn_userlist_rem_buddy(userlist, who, MSN_LIST_FL, old_group_name);
719 } 719 }
720 720
721 /*load userlist from the Blist file cache*/
722 void
723 msn_userlist_load(MsnSession *session)
724 {
725 GaimBlistNode *gnode, *cnode, *bnode;
726 GaimConnection *gc = gaim_account_get_connection(session->account);
727 GSList *l;
728 MsnUser * user;
729
730 g_return_if_fail(gc != NULL);
731
732 for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next){
733 if(!GAIM_BLIST_NODE_IS_GROUP(gnode))
734 continue;
735 for(cnode = gnode->child; cnode; cnode = cnode->next) {
736 if(!GAIM_BLIST_NODE_IS_CONTACT(cnode))
737 continue;
738 for(bnode = cnode->child; bnode; bnode = bnode->next) {
739 GaimBuddy *b;
740 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
741 continue;
742 b = (GaimBuddy *)bnode;
743 if(b->account == gc->account){
744 user = msn_userlist_find_add_user(session->userlist,
745 b->name,NULL);
746 msn_user_set_op(user,MSN_LIST_FL_OP);
747 }
748 }
749 }
750 }
751 for (l = session->account->permit; l != NULL; l = l->next) {
752 user = msn_userlist_find_add_user(session->userlist,
753 (char *)l->data,NULL);
754 msn_user_set_op(user,MSN_LIST_AL_OP);
755 }
756 for (l = session->account->deny; l != NULL; l = l->next) {
757 user = msn_userlist_find_add_user(session->userlist,
758 (char *)l->data,NULL);
759 msn_user_set_op(user,MSN_LIST_BL_OP);
760 }
761
762 }
763