changeset 19825:9cc3a3407816

[gaim-migrate @ 17041] fix the Offline Instant Message sequence bug committed by MaYuan<mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sat, 26 Aug 2006 08:31:37 +0000
parents a8d00b8dae40
children 1d1e5163b0eb
files src/protocols/msn/contact.c src/protocols/msn/oim.c
diffstat 2 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/contact.c	Sat Aug 26 08:07:08 2006 +0000
+++ b/src/protocols/msn/contact.c	Sat Aug 26 08:31:37 2006 +0000
@@ -106,6 +106,13 @@
 	if(!strcmp(type,"Regular")){
 		return 1;
 	}
+	if(!strcmp(type,"Live")){
+		return 1;
+	}
+	if(!strcmp(type,"LivePending")){
+		return 1;
+	}
+
 	return 0;
 }
 
@@ -325,6 +332,13 @@
 		contactType = xmlnode_get_child(contactInfo,"contactType");
 		type = xmlnode_get_data(contactType);
 
+		/*setup the Display Name*/
+		if (!strcmp(type, "Me")){
+			char *friendly = xmlnode_get_data(xmlnode_get_child(contactInfo,"displayName"));
+			gaim_connection_set_display_name(session->account->gc, gaim_url_decode(friendly));
+			g_free(friendly);
+		}
+
 		passportName = xmlnode_get_child(contactInfo,"passportName");
 		if(passportName == NULL){
 			xmlnode *emailsNode, *contactEmailNode, *emailNode;
--- a/src/protocols/msn/oim.c	Sat Aug 26 08:07:08 2006 +0000
+++ b/src/protocols/msn/oim.c	Sat Aug 26 08:31:37 2006 +0000
@@ -115,7 +115,7 @@
 	gaim_debug_info("MaYuan","encode OIM Message...\n");	
 	oim_base64 = gaim_base64_encode((const guchar *)body, strlen(body));
 	gaim_debug_info("MaYuan","encoded base64 body:{%s}\n",oim_base64);	
-
+	gaim_debug_info("MaYuan","url_encode:{%s}\n",gaim_url_encode(body));
 	oim_body = g_strdup_printf(MSN_OIM_MSG_TEMPLATE,
 				oim->run_id,oim->send_seq,oim_base64);
 
@@ -257,7 +257,6 @@
 	 */
 	if(oim->challenge != NULL){
 		msn_handle_chl(oim->challenge, buf);
-		oim_request->send_seq++;
 	}else{
 		gaim_debug_info("MaYuan","no lock key challenge,wait for SOAP Fault and Resend\n");
 		buf[0]='\0';
@@ -284,6 +283,10 @@
 	g_free(msg_body);
 	g_free(soap_body);
 
+	/*increase the offline Sequence control*/
+	if(oim->challenge != NULL){
+		oim->send_seq++;
+	}
 	msn_soap_post(oim->sendconn,soap_request,msn_oim_send_connect_init);
 }