--- a/libpurple/protocols/msn/dialog.c Sun May 27 11:23:09 2007 +0000 +++ b/libpurple/protocols/msn/dialog.c Sun May 27 17:00:06 2007 +0000 @@ -34,9 +34,36 @@ } MsnAddRemData; +/* 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. */ +/* Actually with our MSNP14 code that isn't true yet, he won't be added back :( */ +static void +msn_complete_sync_issue(MsnAddRemData *data) +{ + PurpleBuddy *buddy; + PurpleGroup *group = NULL; + + if (data->group != NULL) + group = purple_find_group(data->group); + + if (group != NULL) + buddy = purple_find_buddy_in_group(purple_connection_get_account(data->gc), data->who, group); + else + buddy = purple_find_buddy(purple_connection_get_account(data->gc), data->who); + + if (buddy != NULL) + purple_blist_remove_buddy(buddy); +} + + static void msn_add_cb(MsnAddRemData *data) { +#if 0 + /* this *should* be necessary !! */ + msn_complete_sync_issue(data); +#endif + if (g_list_find(purple_connections_get_all(), data->gc) != NULL) { MsnSession *session = data->gc->proto_data; @@ -53,6 +80,8 @@ static void msn_rem_cb(MsnAddRemData *data) { + msn_complete_sync_issue(data); + if (g_list_find(purple_connections_get_all(), data->gc) != NULL) { MsnSession *session = data->gc->proto_data; @@ -74,8 +103,6 @@ PurpleAccount *account; MsnAddRemData *data; char *msg, *reason; - PurpleBuddy *buddy; - PurpleGroup *group = NULL; account = session->account; gc = purple_account_get_connection(account); @@ -111,17 +138,6 @@ _("Yes"), G_CALLBACK(msn_add_cb), _("No"), G_CALLBACK(msn_rem_cb)); - if (group_name != NULL) - group = purple_find_group(group_name); - - if (group != NULL) - buddy = purple_find_buddy_in_group(account, passport, group); - else - buddy = purple_find_buddy(account, passport); - - if (buddy != NULL) - purple_blist_remove_buddy(buddy); - g_free(reason); g_free(msg); }