diff src/protocols/msn/oim.c @ 19796:3a15b4e5c336

[gaim-migrate @ 16716] add/delete contact function OK committed by MaYuan<mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sat, 12 Aug 2006 10:30:30 +0000
parents bddd32f36bde
children c2f3cd6626e1
line wrap: on
line diff
--- a/src/protocols/msn/oim.c	Thu Aug 10 15:43:55 2006 +0000
+++ b/src/protocols/msn/oim.c	Sat Aug 12 10:30:30 2006 +0000
@@ -106,7 +106,8 @@
 }
 
 /*pose single message to oim server*/
-void msn_oim_send_single_msg(MsnOim *oim,char * msg)
+void 
+msn_oim_send_single_msg(MsnOim *oim,char * msg)
 {
 	const char *oimsoapbody,*t,*p;
 
@@ -139,6 +140,10 @@
 }
 
 /****************************************
+ * OIM delete SOAP request
+ * **************************************/
+
+/****************************************
  * OIM get SOAP request
  * **************************************/
 /*oim SOAP server login error*/
@@ -179,9 +184,13 @@
 				 GaimInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
-	MsnOim * msnoim;
+	MsnOim * oim = soapconn->session->oim;
 
 	gaim_debug_info("MaYuan","OIM get read buffer:{%s}\n",soapconn->body);
+
+	/*get next single Offline Message*/
+	oim->oim_list = g_list_remove(oim->oim_list, oim->oim_list->data);
+//	msn_oim_get_msg(oim);
 }
 
 static void
@@ -220,7 +229,6 @@
 	if ((conv = msn_oim_get_conv(oim,passport)) != NULL){
 		gaim_conversation_write(conv, NULL, msg, GAIM_MESSAGE_SYSTEM, time(NULL));
 	}
-
 }
 
 /*parse the oim XML data*/
@@ -269,19 +277,15 @@
 					msgid
 					);
 	msn_soap_post(oim->retrieveconn, oimsoapbody, msn_oim_get_written_cb);
-
 }
 
 /*MSN OIM get SOAP request*/
 void msn_oim_get_msg(MsnOim *oim)
 {
-	GList *list;	
-
 	gaim_debug_info("MaYuan","Get OIM with SOAP \n");
 //	gaim_debug_info("MaYuan","oim->oim_list:%p,data:%s \n",oim->oim_list,oim->oim_list->data);
-	for(list = oim->oim_list; list!= NULL;list = g_list_next(list)){
-		msn_oim_post_single_get_msg(oim,list->data);
-		oim->oim_list = g_list_remove(oim->oim_list, list->data);
+	if(oim->oim_list !=NULL){
+		msn_oim_post_single_get_msg(oim,oim->oim_list->data);
 	}
 }