changeset 20774:d1e8f4d63f01

merge of '701fb7aea7a77b05725227038ec645441c76668c' and '82ae4511a5006e8f04cd58e034b718deba69321a'
author Carlos Silva <typ0@pidgin.im>
date Thu, 04 Oct 2007 02:42:15 +0000
parents 712020cd7c8e (current diff) dcb28d9939ee (diff)
children d3443cb6a60f 29d8c86c14cd
files libpurple/protocols/msn/contact.c libpurple/protocols/msn/soap.c
diffstat 4 files changed, 29 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Thu Oct 04 01:25:43 2007 +0000
+++ b/libpurple/protocols/msn/contact.c	Thu Oct 04 02:42:15 2007 +0000
@@ -1024,12 +1024,7 @@
 	user = msn_userlist_find_add_user(userlist, state->who, state->who);
 	msn_user_add_group_id(user, state->guid);
 
-	if (msn_userlist_user_is_in_list(user, MSN_LIST_PL)) {
-		msn_del_contact_from_list(soapconn->session->contact, NULL, state->who, MSN_LIST_PL);
-	} else {
-		msn_soap_free_read_buf(soapconn);
-	}
-	
+	msn_soap_free_read_buf(soapconn);
 	msn_callback_state_free(state);
 
 	return TRUE;
@@ -1111,7 +1106,6 @@
 	}
 
 	if (state->action & MSN_ADD_BUDDY) {
-		MsnUser *user = msn_userlist_find_user(userlist, state->who);
 
         	if ( !msn_user_is_yahoo(soapconn->session->account, state->who) ) {
 
@@ -1119,12 +1113,6 @@
 		                msn_userlist_add_buddy_to_list(userlist, state->who, MSN_LIST_FL);
 	        }
 	        msn_notification_send_fqy(soapconn->session, state->who);
-
-		if (msn_userlist_user_is_in_list(user, MSN_LIST_PL)) {
-			msn_del_contact_from_list(soapconn->session->contact, NULL, state->who, MSN_LIST_PL);
-			msn_callback_state_free(state);
-			return TRUE;
-		}
 	}
 
 	if (state->action & MSN_MOVE_BUDDY) {
@@ -1437,6 +1425,7 @@
 	g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
 	g_return_val_if_fail(soapconn->session != NULL, FALSE);
 	g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
+	g_return_val_if_fail(soapconn->session->userlist != NULL, FALSE);
 
 	state = (MsnCallbackState *) soapconn->data_cb;
 
@@ -1448,6 +1437,11 @@
 	purple_debug_info("MSN CL", "Contact %s deleted successfully from %s list on server!\n", state->who, MsnMemberRole[state->list_id]);
 
 	if (state->list_id == MSN_LIST_PL) {
+		MsnUser *user = msn_userlist_find_user(soapconn->session->userlist, state->who);
+		
+		if (user != NULL)
+			msn_user_unset_op(user, MSN_LIST_PL_OP);
+
 		msn_add_contact_to_list(soapconn->session->contact, state, state->who, MSN_LIST_RL);
 		return TRUE;
 	}
@@ -1541,6 +1535,8 @@
 	MsnCallbackState *state = NULL;
 
 	g_return_val_if_fail(soapconn->data_cb != NULL, TRUE);
+	g_return_val_if_fail(soapconn->session != NULL, FALSE);
+	g_return_val_if_fail(soapconn->session->userlist != NULL, FALSE);
 
 	state = (MsnCallbackState *) soapconn->data_cb;
 	
@@ -1551,12 +1547,19 @@
 	
 	purple_debug_info("MSN CL", "Contact %s added successfully to %s list on server!\n", state->who, MsnMemberRole[state->list_id]);
 
-	if (state->list_id == MSN_LIST_RL && (state->action & MSN_DENIED_BUDDY) ) {
-		g_return_val_if_fail(soapconn->session != NULL, FALSE);
-		g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
+	if (state->list_id == MSN_LIST_RL) {
+		MsnUser *user = msn_userlist_find_user(soapconn->session->userlist, state->who);
+		
+		if (user != NULL) {
+			msn_user_set_op(user, MSN_LIST_RL_OP);
+		}
 
-		msn_add_contact_to_list(soapconn->session->contact, NULL, state->who, MSN_LIST_BL);
-		return TRUE;
+		if (state->action & MSN_DENIED_BUDDY) {
+			g_return_val_if_fail(soapconn->session->contact != NULL, FALSE);
+
+			msn_add_contact_to_list(soapconn->session->contact, NULL, state->who, MSN_LIST_BL);
+			return TRUE;
+		}
 	}
 
 	if (state->list_id == MSN_LIST_AL) {
--- a/libpurple/protocols/msn/notification.c	Thu Oct 04 01:25:43 2007 +0000
+++ b/libpurple/protocols/msn/notification.c	Thu Oct 04 02:42:15 2007 +0000
@@ -1203,8 +1203,6 @@
 	MsnSession *session = cmdproc->session;
 	const char *type, *value, *friendlyname;
 
-	purple_debug_info("MSN Notification", "prp_cmd()\n");
-
 	g_return_if_fail(cmd->param_count >= 3);
 
 	type  = cmd->params[2];
--- a/libpurple/protocols/msn/soap.c	Thu Oct 04 01:25:43 2007 +0000
+++ b/libpurple/protocols/msn/soap.c	Thu Oct 04 02:42:15 2007 +0000
@@ -764,7 +764,7 @@
  * if not connected, Connected first.
  */
 void
-msn_soap_post(MsnSoapConn *soapconn,MsnSoapReq *request)
+msn_soap_post(MsnSoapConn *soapconn, MsnSoapReq *request)
 {
 	MsnSoapReq *head_request;
 
@@ -808,10 +808,15 @@
 			return;
 		}
 
+#ifdef MSN_SOAP_DEBUG
 		purple_debug_info("MSN SOAP", "Currently processing another SOAP request\n");
 	} else {
 		purple_debug_info("MSN SOAP", "No requests left to dispatch\n");
 	}
+#else
+      }
+#endif
+
 }
 
 /*Post the soap request action*/
--- a/libpurple/protocols/msn/userlist.c	Thu Oct 04 01:25:43 2007 +0000
+++ b/libpurple/protocols/msn/userlist.c	Thu Oct 04 02:42:15 2007 +0000
@@ -48,13 +48,10 @@
 	{
 		MsnSession *session = pa->gc->proto_data;
 		MsnUserList *userlist = session->userlist;
-		MsnUser *user = msn_userlist_find_add_user(userlist, pa->who, pa->who);
-
-
+		
 		msn_userlist_add_buddy_to_list(userlist, pa->who, MSN_LIST_AL);
 
-		if (msn_userlist_user_is_in_list(user, MSN_LIST_FL))
-			msn_del_contact_from_list(session->contact, NULL, pa->who, MSN_LIST_PL);
+		msn_del_contact_from_list(session->contact, NULL, pa->who, MSN_LIST_PL);
 	}
 
 	g_free(pa->who);