# HG changeset patch # User Elliott Sales de Andrade # Date 1222925858 0 # Node ID 7ec9a1ae93d7959d20305d8e4e999559196a34a3 # Parent 89cb9c0f5bd951e00a591602a7f3d7eac0bcbb78 Save the MSN ContactID after adding a buddy so it can be used for subsequent operations. This should fix moving the buddy between groups or deleting the buddy during the same session the buddy was added. Fixes #7274. diff -r 89cb9c0f5bd9 -r 7ec9a1ae93d7 libpurple/protocols/msn/contact.c --- a/libpurple/protocols/msn/contact.c Thu Oct 02 04:59:13 2008 +0000 +++ b/libpurple/protocols/msn/contact.c Thu Oct 02 05:37:38 2008 +0000 @@ -941,6 +941,7 @@ MsnUserList *userlist; MsnUser *user; + xmlnode *guid; g_return_if_fail(session != NULL); @@ -960,6 +961,15 @@ user = msn_userlist_find_add_user(userlist, state->who, state->who); msn_user_add_group_id(user, state->guid); + + guid = xmlnode_get_child(resp->xml, + "Body/ABContactAddResponse/ABContactAddResult/guid"); + if (guid != NULL) { + char *uid = xmlnode_get_data(guid); + msn_user_set_uid(user, uid); + purple_debug_info("msn", "Set %s guid to %s.\n", state->who, uid); + g_free(uid); + } } /* add a Contact in MSN_INDIVIDUALS_GROUP */ @@ -1016,6 +1026,15 @@ if (state->action & MSN_ADD_BUDDY) { MsnUser *user = msn_userlist_find_user(userlist, state->who); + xmlnode *guid = xmlnode_get_child(resp->xml, + "Body/ABGroupContactAddResponse/ABGroupContactAddResult/guid"); + + if (guid != NULL) { + char *uid = xmlnode_get_data(guid); + msn_user_set_uid(user, uid); + purple_debug_info("msn", "Set %s guid to %s.\n", state->who, uid); + g_free(uid); + } if ( !msn_user_is_yahoo(state->session->account, state->who) ) { msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_AL);