changeset 19791:bddd32f36bde

[gaim-migrate @ 16653] a version can show the windows Live ID's Info correctly ready to send the oim,need to check committed by Ma Yuan<mayuan2006@gmail.com> committer: Ethan Blanton <elb@pidgin.im>
author Ma Yuan <mayuan2006@gmail.com>
date Sun, 06 Aug 2006 15:16:46 +0000
parents 4f21c73a0c48
children d55d8050f54d
files src/protocols/msn/group.h src/protocols/msn/msn.c src/protocols/msn/msn.h src/protocols/msn/notification.c src/protocols/msn/oim.c src/protocols/msn/slp.c src/protocols/msn/soap.c src/protocols/msn/switchboard.c src/protocols/msn/userlist.c
diffstat 9 files changed, 44 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/group.h	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/group.h	Sun Aug 06 15:16:46 2006 +0000
@@ -40,7 +40,7 @@
 #define MSN_GROUP_IDS	"<guid>9e57e654-59f0-44d1-aedc-0a7500b7e51f</guid>"
 #define MSN_DELETE_GROUP_TEMPLATE	"<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"><soap:Header><ABApplicationHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ApplicationId>09607671-1C32-421F-A6A6-CBFAA51AB5F4</ApplicationId><IsMigration>false</IsMigration><PartnerScenario>Timer</PartnerScenario></ABApplicationHeader><ABAuthHeader xmlns=\"http://www.msn.com/webservices/AddressBook\"><ManagedGroupRequest>false</ManagedGroupRequest></ABAuthHeader></soap:Header><soap:Body><ABGroupDelete xmlns=\"http://www.msn.com/webservices/AddressBook\"><abId>00000000-0000-0000-0000-000000000000</abId><groupFilter><groupIds>%s</groupIds></groupFilter></ABGroupDelete></soap:Body></soap:Envelope>"
 
-#define MSN_INDIVIDUALS_GROUP_ID	"123"
+#define MSN_INDIVIDUALS_GROUP_ID	"1983"
 #define MSN_INDIVIDUALS_GROUP_NAME	"Other Contacts"
 
 #define MSN_NON_IM_GROUP_ID		"email"
--- a/src/protocols/msn/msn.c	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/msn.c	Sun Aug 06 15:16:46 2006 +0000
@@ -565,6 +565,8 @@
 							   (user->list_op & (1 << MSN_LIST_BL)) ?
 							   _("Yes") : _("No"));
 	}
+
+	gaim_debug_info("MaYuan","tooltip string:{%s}\n",str);
 }
 
 static GList *
@@ -778,6 +780,7 @@
 	char *msgformat;
 	char *msgtext;
 
+	gaim_debug_info("MaYuan","send IM {%s}\n",message);
 	account = gaim_connection_get_account(gc);
 
 	msn_import_html(message, &msgformat, &msgtext);
@@ -1373,6 +1376,7 @@
 							  "\n", "<br>");
 		g_string_free(str, TRUE);
 		g_string_append_printf(s, "%s<br>", tmp);
+//		gaim_debug_info("MaYuan","tooltip info string:{%s}\n",s);
 		g_free(tmp);
 	}
 
@@ -1414,7 +1418,7 @@
 
 #define MSN_GOT_INFO_GET_FIELD(a, b) \
 	found = gaim_markup_extract_info_field(stripped, stripped_len, s, \
-			"\n" a "\t", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \
+			"\n" a ":\t", 0, "\n", 0, "Undisclosed", b, 0, NULL, NULL); \
 	if (found) \
 		sect_info = TRUE;
 
@@ -1440,7 +1444,7 @@
 	MsnGetInfoStepTwoData *info2_data = NULL;
 #endif
 
-	gaim_debug_info("msn", "In msn_got_info\n");
+	gaim_debug_info("msn", "In msn_got_info,url_text:{%s}\n",url_text);
 
 	/* Make sure the connection is still valid */
 	if (g_list_find(gaim_connections_get_all(), info_data->gc) == NULL)
--- a/src/protocols/msn/msn.h	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/msn.h	Sun Aug 06 15:16:46 2006 +0000
@@ -77,7 +77,8 @@
 
 #define HOTMAIL_URL "http://www.hotmail.com/cgi-bin/folders"
 #define PASSPORT_URL "http://lc1.law13.hotmail.passport.com/cgi-bin/dologin?login="
-#define PROFILE_URL "http://spaces.msn.com/profile.aspx?mem="
+/*#define PROFILE_URL "http://spaces.msn.com/profile.aspx?mem="*/
+#define PROFILE_URL "http://spaces.live.com/profile.aspx?mem="
 
 #define USEROPT_HOTMAIL 0
 
--- a/src/protocols/msn/notification.c	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/notification.c	Sun Aug 06 15:16:46 2006 +0000
@@ -1357,6 +1357,7 @@
 	g_hash_table_destroy(table);
 }
 
+/*offline Message notification process*/
 static void
 initial_mdata_msg(MsnCmdProc *cmdproc, MsnMessage *msg)
 {
@@ -1599,9 +1600,14 @@
 	msn_table_add_msg_type(cbs_table,
 						   "text/x-msmsgsprofile",
 						   profile_msg);
+	/*initial OIM notification*/
 	msn_table_add_msg_type(cbs_table,
 							"text/x-msmsgsinitialmdatanotification",
 							initial_mdata_msg);	
+	/*OIM notification when user online*/
+	msn_table_add_msg_type(cbs_table,
+							"text/x-msmsgsoimnotification",
+							initial_mdata_msg);	
 	msn_table_add_msg_type(cbs_table,
 						   "text/x-msmsgsinitialemailnotification",
 						   initial_email_msg);
@@ -1618,3 +1624,4 @@
 {
 	msn_table_destroy(cbs_table);
 }
+
--- a/src/protocols/msn/oim.c	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/oim.c	Sun Aug 06 15:16:46 2006 +0000
@@ -181,7 +181,7 @@
 	MsnSoapConn * soapconn = data;	
 	MsnOim * msnoim;
 
-	gaim_debug_info("MaYuan","read buffer:{%s}\n",soapconn->body);
+	gaim_debug_info("MaYuan","OIM get read buffer:{%s}\n",soapconn->body);
 }
 
 static void
@@ -296,12 +296,13 @@
 					msn_oim_get_connect_cb,
 					msn_oim_get_error_cb);
 	}
-
+#if 0
 	if(msn_soap_connected(oim->sendconn) == -1){
 		msn_soap_init(oim->sendconn,MSN_OIM_SEND_HOST,1,
 					msn_oim_send_connect_cb,
 					msn_oim_send_error_cb);
 	}
+#endif
 }
 
 /*endof oim.c*/
--- a/src/protocols/msn/slp.c	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/slp.c	Sun Aug 06 15:16:46 2006 +0000
@@ -33,6 +33,8 @@
 
 /* ms to delay between sending buddy icon requests to the server. */
 #define BUDDY_ICON_DELAY 20000
+/*debug SLP*/
+#define MSN_DEBUG_UD
 
 static void send_ok(MsnSlpCall *slpcall, const char *branch,
 					const char *type, const char *content);
--- a/src/protocols/msn/soap.c	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/soap.c	Sun Aug 06 15:16:46 2006 +0000
@@ -102,8 +102,11 @@
 void
 msn_soap_destroy(MsnSoapConn *soapconn)
 {
-	g_free(soapconn->login_host);
-	g_free(soapconn->login_path);
+	if(soapconn->login_host)
+		g_free(soapconn->login_host);
+
+	if(soapconn->login_path)
+		g_free(soapconn->login_path);
 
 	/*remove the write handler*/
 	if (soapconn->output_handler > 0){
--- a/src/protocols/msn/switchboard.c	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/switchboard.c	Sun Aug 06 15:16:46 2006 +0000
@@ -29,6 +29,8 @@
 
 #include "error.h"
 
+#define MSN_DEBUG_SB
+
 static MsnTable *cbs_table;
 
 static void msg_error_helper(MsnCmdProc *cmdproc, MsnMessage *msg,
@@ -615,6 +617,7 @@
 	g_return_if_fail(swboard != NULL);
 	g_return_if_fail(msg     != NULL);
 
+	gaim_debug_info("Ma Yuan","switchboard send msg..\n");
 	if (msn_switchboard_can_send(swboard))
 		release_msg(swboard, msg);
 	else if (queue)
@@ -1051,6 +1054,8 @@
 cal_error(MsnCmdProc *cmdproc, MsnTransaction *trans, int error)
 {
 	int reason = MSN_SB_ERROR_UNKNOWN;
+	MsnMessage *msg;
+	MsnSwitchBoard *swboard = trans->data;
 
 	if (error == 215)
 	{
@@ -1063,7 +1068,19 @@
 	}
 
 	gaim_debug_warning("msn", "cal_error: command %s gave error %i\n", trans->command, error);
+	gaim_debug_warning("msn", "Will Use Offline Message to sendit\n");
 
+//	cal_error_helper(trans, reason);
+	/*offline Message send Process*/
+
+	while ((msg = g_queue_pop_head(swboard->msg_queue)) != NULL){
+		gaim_debug_warning("Ma Yuan","offline msg to send:{%s}\n",msg->body);
+		/* The messages could not be sent due to a switchboard error */
+		swboard->error = MSN_SB_ERROR_USER_OFFLINE;
+		msg_error_helper(swboard->cmdproc, msg,
+							 MSN_MSG_ERROR_SB);
+		msn_message_unref(msg);
+	}
 	cal_error_helper(trans, reason);
 }
 
--- a/src/protocols/msn/userlist.c	Wed Aug 02 05:44:42 2006 +0000
+++ b/src/protocols/msn/userlist.c	Sun Aug 06 15:16:46 2006 +0000
@@ -617,6 +617,7 @@
 	msn_notification_rem_buddy(userlist->session->notification, list, who, group_id);
 }
 
+/*add buddy*/
 void
 msn_userlist_add_buddy(MsnUserList *userlist,
 					   const char *who, int list_id,