Mercurial > pidgin
changeset 21106:95684692f622
fix up bad merge the bad way
author | Ka-Hing Cheung <khc@hxbc.us> |
---|---|
date | Thu, 25 Oct 2007 08:32:44 +0000 |
parents | 66424ff7b9db |
children | cc43e75a1da7 |
files | libpurple/protocols/msn/contact.c |
diffstat | 1 files changed, 20 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c Thu Oct 25 08:15:53 2007 +0000 +++ b/libpurple/protocols/msn/contact.c Thu Oct 25 08:32:44 2007 +0000 @@ -924,27 +924,21 @@ msn_delete_contact_read_cb(MsnSoapMessage *req, MsnSoapMessage *resp, gpointer data) { - if (resp == NULL) - return; + MsnCallbackState *state = data; + + if (resp != NULL) { + MsnUser *user; + MsnUserList *userlist = state->session->userlist; - purple_debug_info("MSNCL","Delete contact successful\n"); + purple_debug_info("MSNCL","Delete contact successful\n"); - user = msn_userlist_find_user_with_id(userlist, state->uid); - if (user != NULL) { - msn_userlist_remove_user(userlist, user); + user = msn_userlist_find_user_with_id(userlist, state->uid); + if (user != NULL) { + msn_userlist_remove_user(userlist, user); + } } msn_callback_state_free(state); - msn_soap_free_read_buf(soapconn); - - return TRUE; -} - -static void -msn_delete_contact_written_cb(MsnSoapConn *soapconn) -{ - purple_debug_info("MSNCL","Delete contact request written\n"); - soapconn->read_cb = msn_delete_contact_read_cb; } /*delete a Contact*/ @@ -953,24 +947,23 @@ { gchar *body = NULL; gchar *contact_id_xml = NULL ; + MsnCallbackState *state; g_return_if_fail(contactId != NULL); contact_id_xml = g_strdup_printf(MSN_CONTACT_ID_XML, contactId); - state = msn_callback_state_new(); + state = msn_callback_state_new(contact->session); msn_callback_state_set_uid(state, contactId); /* build SOAP request */ purple_debug_info("MSNCL","Deleting contact with contactId: %s\n", contactId); body = g_strdup_printf(MSN_DEL_CONTACT_TEMPLATE, contact_id_xml); - soap_request = msn_soap_request_new(MSN_CONTACT_SERVER, - MSN_ADDRESS_BOOK_POST_URL, - MSN_CONTACT_DEL_SOAP_ACTION, - body, - state, - msn_delete_contact_read_cb, - msn_delete_contact_written_cb, - msn_contact_connect_init); + + msn_soap_message_send(state->session, + msn_soap_message_new(MSN_CONTACT_DEL_SOAP_ACTION, + xmlnode_from_str(body, -1)), + MSN_CONTACT_SERVER, MSN_ADDRESS_BOOK_POST_URL, + msn_delete_contact_read_cb, state); g_free(contact_id_xml); g_free(body); @@ -1181,9 +1174,9 @@ } if (state->list_id == MSN_LIST_AL) { - purple_privacy_permit_add(soapconn->session->account, state->who, TRUE); + purple_privacy_permit_add(state->session->account, state->who, TRUE); } else if (state->list_id == MSN_LIST_BL) { - purple_privacy_deny_add(soapconn->session->account, state->who, TRUE); + purple_privacy_deny_add(state->session->account, state->who, TRUE); } msn_callback_state_free(state);