changeset 19785:ea8b7028e8bb

[gaim-migrate @ 17057] fix contact delete bug: when Send ADL,NS disconnect.<fix the add/delte XML format> committed by MaYuan<mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sun, 27 Aug 2006 11:45:02 +0000
parents 3b971c87279d
children ef06a1fb425e
files src/protocols/msn/README src/protocols/msn/contact.c src/protocols/msn/notification.c src/protocols/msn/userlist.c
diffstat 4 files changed, 17 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/README	Sun Aug 27 10:34:17 2006 +0000
+++ b/src/protocols/msn/README	Sun Aug 27 11:45:02 2006 +0000
@@ -30,7 +30,11 @@
 * Windows Live ID authentication.
 
 * Offline Instant Message
-Now can send and receive the Offline Instant Message.
+Now can send and receive the Offline Instant Message to MSN user and Yahoo User.
+
+*contact management
+Can add/delete Contact
+Can add/delete Group
 
 * Communicate with Yahoo User
 Can send/receive Message/Nudge to Yahoo User.
--- a/src/protocols/msn/contact.c	Sun Aug 27 10:34:17 2006 +0000
+++ b/src/protocols/msn/contact.c	Sun Aug 27 11:45:02 2006 +0000
@@ -554,7 +554,7 @@
 	char *contact_xml = NULL ;
 	MsnSoapReq *soap_request;
 
-	g_return_if_fail(contactId == NULL);
+	g_return_if_fail(contactId != NULL);
 	gaim_debug_info("MaYuan","msn delete a contact,contactId:{%s}...\n",contactId);
 	contact_xml = g_strdup_printf(MSN_CONTACTS_DEL_XML,contactId);
 	body = g_strdup_printf(MSN_DEL_CONTACT_TEMPLATE,contact_xml);
--- a/src/protocols/msn/notification.c	Sun Aug 27 10:34:17 2006 +0000
+++ b/src/protocols/msn/notification.c	Sun Aug 27 11:45:02 2006 +0000
@@ -1739,15 +1739,17 @@
 
 	adl_node = xmlnode_new("ml");
 	adl_node->child = NULL;
-	xmlnode_set_attrib(adl_node, "l", "1");
 
-	msn_add_contact_xml(adl_node,who,3,1);
+	msn_add_contact_xml(adl_node,who,1,1);
 
 	payload = xmlnode_to_str(adl_node,&payload_len);
 	xmlnode_free(adl_node);
-
-	msn_notification_post_adl(notification->servconn->cmdproc,
+	if(msn_user_is_yahoo(notification->session->account,who)){
+		msn_notification_fqy_yahoo(notification->session, who);
+	}else{
+		msn_notification_post_adl(notification->servconn->cmdproc,
 							payload,payload_len);
+	}
 }
 
 void
@@ -1764,9 +1766,8 @@
 
 	rml_node = xmlnode_new("ml");
 	rml_node->child = NULL;
-	xmlnode_set_attrib(rml_node, "l", "1");
 
-	msn_add_contact_xml(rml_node,who,3,1);
+	msn_add_contact_xml(rml_node,who,1,1);
 
 	payload = xmlnode_to_str(rml_node,&payload_len);
 	xmlnode_free(rml_node);
--- a/src/protocols/msn/userlist.c	Sun Aug 27 10:34:17 2006 +0000
+++ b/src/protocols/msn/userlist.c	Sun Aug 27 11:45:02 2006 +0000
@@ -610,6 +610,8 @@
 
 	user = msn_userlist_find_user(userlist, who);
 
+	g_return_if_fail(user != NULL);
+
 	/*delete the contact from address book via soap action*/
 	msn_delete_contact(userlist->session->contact,user->uid);
 
@@ -636,7 +638,7 @@
 	/* Then request the rem to the server. */
 	list = lists[list_id];
 
-//	msn_notification_rem_buddy(userlist->session->notification, list, who, group_id);
+	msn_notification_rem_buddy(userlist->session->notification, list, who, group_id);
 }
 
 /*add buddy*/
@@ -693,7 +695,7 @@
 
 	gaim_debug_info("MaYuan", "add user:{%s} to group id {%s}\n",store_name ,group_id);
 	msn_add_contact(userlist->session->contact,who,group_id);
-#if 0
+#if 1
 	msn_notification_add_buddy(userlist->session->notification, list, who,
 							   store_name, group_id);
 #endif