/* Remove the buddy referenced by the MsnAddRemData before the serverside list is changed. * If the buddy will be added, he'll be added back; if he will be removed, he won't be. */ static void msn_complete_sync_issue(MsnAddRemData *data) { GaimBuddy *buddy; GaimGroup *group = NULL; if (data->group != NULL) group = gaim_find_group(data->group); if (group != NULL) buddy = gaim_find_buddy_in_group(gaim_connection_get_account(data->gc), data->who, group); else buddy = gaim_find_buddy(gaim_connection_get_account(data->gc), data->who); if (buddy != NULL) gaim_blist_remove_buddy(buddy); }
void msn_user_add_group_id(MsnUser *user, int id) { MsnUserList *userlist; GaimAccount *account; GaimBuddy *b; GaimGroup *g; const char *passport; const char *group_name; g_return_if_fail(user != NULL); g_return_if_fail(id >= 0); user->group_ids = g_list_append(user->group_ids, GINT_TO_POINTER(id)); userlist = user->userlist; account = userlist->session->account; passport = msn_user_get_passport(user); group_name = msn_userlist_find_group_name(userlist, id); g = gaim_find_group(group_name); if ((id == 0) && (g == NULL)) { g = gaim_group_new(group_name); gaim_blist_add_group(g, NULL); } b = gaim_find_buddy_in_group(account, passport, g); if (b == NULL) { b = gaim_buddy_new(account, passport, NULL); gaim_blist_add_buddy(b, NULL, g, NULL); } b->proto_data = user; }