changeset 20402:00e7d8ded567

propagate from branch 'im.pidgin.rlaager.merging.msnp13-and-pidgin' (head 8cfbe223ca6e514146a4d46aeab4c7816de17b79) to branch 'im.pidgin.cpw.khc.msnp14' (head d64cf2078da03ec91620a88bb3408d3eb14a19e2)
author Richard Laager <rlaager@wiktel.com>
date Sun, 15 Apr 2007 05:01:55 +0000
parents 4ddc27c18781 (diff) ea9a5566a156 (current diff)
children 599b5a4aebab
files libpurple/protocols/msn/msn-utils.c libpurple/protocols/msn/msn-utils.h libpurple/protocols/msn/state.c libpurple/protocols/msn/user.h
diffstat 7 files changed, 216 insertions(+), 216 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/.todo	Sun Apr 15 05:00:56 2007 +0000
+++ b/libpurple/protocols/msn/.todo	Sun Apr 15 05:01:55 2007 +0000
@@ -11,7 +11,7 @@
             when you authorize someone to add you, the corresponding dialog to add them is blank
         </note>
         <note priority="medium" time="1036042128">
-            Majortool says to tell sean about "already in opposite list" errors are still happening, now whenever you start gaim. follow from prior conversation. javabsp|away: the (C) and (R) works (23:02:54) MajorTool: LSchiere: yeah what javabsp|away is talking about but its certain ones
+            Majortool says to tell sean about "already in opposite list" errors are still happening, now whenever you start purple. follow from prior conversation. javabsp|away: the (C) and (R) works (23:02:54) MajorTool: LSchiere: yeah what javabsp|away is talking about but its certain ones
         </note>
     </note>
     <note priority="medium" time="1052795462">
--- a/libpurple/protocols/msn/contact.c	Sun Apr 15 05:00:56 2007 +0000
+++ b/libpurple/protocols/msn/contact.c	Sun Apr 15 05:01:55 2007 +0000
@@ -3,9 +3,9 @@
  * 	get MSN contacts via SOAP request
  *	created by MaYuan<mayuan2006@gmail.com>
  *
- * gaim
+ * purple
  *
- * Gaim is the legal property of its developers, whose names are too numerous
+ * Purple is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
  *
@@ -56,7 +56,7 @@
 
 /*contact SOAP server login error*/
 static void
-msn_contact_login_error_cb(GaimSslConnection *gsc, GaimSslErrorType error, void *data)
+msn_contact_login_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, void *data)
 {
 	MsnSoapConn *soapconn = data;
 	MsnSession *session;
@@ -69,8 +69,8 @@
 
 /*msn contact SOAP server connect process*/
 static void
-msn_contact_login_connect_cb(gpointer data, GaimSslConnection *gsc,
-				 GaimInputCondition cond)
+msn_contact_login_connect_cb(gpointer data, PurpleSslConnection *gsc,
+				 PurpleInputCondition cond)
 {
 	MsnSoapConn *soapconn = data;
 	MsnSession * session;
@@ -131,16 +131,16 @@
 	char *LastChangeStr;
 
 	session = contact->session;
-	gaim_debug_misc("MSNCL","parse contact list:{%s}\nsize:%d\n",contact->soapconn->body,contact->soapconn->body_len);
+	purple_debug_misc("MSNCL","parse contact list:{%s}\nsize:%d\n",contact->soapconn->body,contact->soapconn->body_len);
 	node = 	xmlnode_from_str(contact->soapconn->body, contact->soapconn->body_len);
 
 	if(node == NULL){
-		gaim_debug_misc("MSNCL","parse contact from str err!\n");
+		purple_debug_misc("MSNCL","parse contact from str err!\n");
 		return;
 	}
-	gaim_debug_misc("MSNCL","node{%p},name:%s,child:%s,last:%s\n",node,node->name,node->child->name,node->lastchild->name);
+	purple_debug_misc("MSNCL","node{%p},name:%s,child:%s,last:%s\n",node,node->name,node->child->name,node->lastchild->name);
 	body = xmlnode_get_child(node,"Body");
-	gaim_debug_misc("MSNCL","body{%p},name:%s\n",body,body->name);
+	purple_debug_misc("MSNCL","body{%p},name:%s\n",body,body->name);
 	response = xmlnode_get_child(body,"FindMembershipResponse");
 
 	if (response == NULL) {
@@ -153,27 +153,27 @@
 		return;
 	}
 
-	gaim_debug_misc("MSNCL","response{%p},name:%s\n",response,response->name);
+	purple_debug_misc("MSNCL","response{%p},name:%s\n",response,response->name);
 	result =xmlnode_get_child(response,"FindMembershipResult");
 	if(result == NULL){
-		gaim_debug_misc("MSNCL","receive No Update!\n");
+		purple_debug_misc("MSNCL","receive No Update!\n");
 		return;
 	}
-	gaim_debug_misc("MSNCL","result{%p},name:%s\n",result,result->name);
+	purple_debug_misc("MSNCL","result{%p},name:%s\n",result,result->name);
 	services =xmlnode_get_child(result,"Services");
-	gaim_debug_misc("MSNCL","services{%p},name:%s\n",services,services->name);
+	purple_debug_misc("MSNCL","services{%p},name:%s\n",services,services->name);
 	service =xmlnode_get_child(services,"Service");
-	gaim_debug_misc("MSNCL","service{%p},name:%s\n",service,service->name);
+	purple_debug_misc("MSNCL","service{%p},name:%s\n",service,service->name);
 	
 	/*Last Change Node*/
 	LastChangeNode = xmlnode_get_child(service,"LastChange");
 	LastChangeStr = xmlnode_get_data(LastChangeNode);
-	gaim_debug_misc("MSNCL","LastChangeNode0 %s\n",LastChangeStr);	
-	gaim_blist_node_set_string(msn_session_get_bnode(contact->session),"CLLastChange",LastChangeStr);
-	gaim_debug_misc("MSNCL","LastChangeNode %s\n",LastChangeStr);
+	purple_debug_misc("MSNCL","LastChangeNode0 %s\n",LastChangeStr);	
+	purple_blist_node_set_string(msn_session_get_bnode(contact->session),"CLLastChange",LastChangeStr);
+	purple_debug_misc("MSNCL","LastChangeNode %s\n",LastChangeStr);
 	
 	memberships =xmlnode_get_child(service,"Memberships");
-	gaim_debug_misc("MSNCL","memberships{%p},name:%s\n",memberships,memberships->name);
+	purple_debug_misc("MSNCL","memberships{%p},name:%s\n",memberships,memberships->name);
 	for(membershipnode = xmlnode_get_child(memberships, "Membership"); membershipnode;
 					membershipnode = xmlnode_get_next_twin(membershipnode)){
 		xmlnode *roleNode;
@@ -181,7 +181,7 @@
 		roleNode = xmlnode_get_child(membershipnode,"MemberRole");
 		role=xmlnode_get_data(roleNode);
 		list_op = msn_get_memberrole(role);
-		gaim_debug_misc("MSNCL","MemberRole role:%s,list_op:%d\n",role,list_op);
+		purple_debug_misc("MSNCL","MemberRole role:%s,list_op:%d\n",role,list_op);
 		g_free(role);
 		members = xmlnode_get_child(membershipnode,"Members");
 		for(member = xmlnode_get_child(members, "Member"); member;
@@ -190,13 +190,13 @@
 			xmlnode * typeNode;
 			char * type;
 
-			gaim_debug_misc("MSNCL","type:%s\n",xmlnode_get_attrib(member,"type"));
+			purple_debug_misc("MSNCL","type:%s\n",xmlnode_get_attrib(member,"type"));
 			if(!g_strcasecmp(xmlnode_get_attrib(member,"type"),"PassportMember")){
 				passportNode = xmlnode_get_child(member,"PassportName");
 				passport = xmlnode_get_data(passportNode);
 				typeNode = xmlnode_get_child(member,"Type");
 				type = xmlnode_get_data(typeNode);
-				gaim_debug_misc("MSNCL","Passport name:%s,type:%s\n",passport,type);
+				purple_debug_misc("MSNCL","Passport name:%s,type:%s\n",passport,type);
 				g_free(type);
 
 				user = msn_userlist_find_add_user(session->userlist,passport,NULL);
@@ -210,7 +210,7 @@
 
 				emailNode = xmlnode_get_child(member,"Email");
 				passport = xmlnode_get_data(emailNode);
-				gaim_debug_info("MSNCL","Email Member :name:%s,list_op:%d\n",passport,list_op);
+				purple_debug_info("MSNCL","Email Member :name:%s,list_op:%d\n",passport,list_op);
 				user = msn_userlist_find_add_user(session->userlist,passport,NULL);
 				msn_got_lst_user(session,user,list_op,NULL);
 				g_free(passport);
@@ -222,7 +222,7 @@
 }
 
 static void
-msn_get_contact_list_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_get_contact_list_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn *soapconn = data;	
 	MsnContact *contact;
@@ -236,23 +236,23 @@
 	g_return_if_fail(session != NULL);
 
 #ifdef  MSN_CONTACT_SOAP_DEBUG
-	gaim_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf);
+	purple_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf);
 #endif
 	msn_parse_contact_list(contact);
 	/*free the read buffer*/
 	msn_soap_free_read_buf(soapconn);
 
-	abLastChange = gaim_blist_node_get_string(msn_session_get_bnode(contact->session),"ablastChange");
-	dynamicItemLastChange = gaim_blist_node_get_string(msn_session_get_bnode(contact->session),"dynamicItemLastChange");
+	abLastChange = purple_blist_node_get_string(msn_session_get_bnode(contact->session),"ablastChange");
+	dynamicItemLastChange = purple_blist_node_get_string(msn_session_get_bnode(contact->session),"dynamicItemLastChange");
 	msn_get_address_book(contact, abLastChange, dynamicItemLastChange);
 }
 
 static void
-msn_get_contact_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_get_contact_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","finish contact written\n");
+	purple_debug_info("MaYuan","finish contact written\n");
 	soapconn->read_cb = msn_get_contact_list_cb;
 //	msn_soap_read_cb(data,source,cond);
 }
@@ -265,9 +265,9 @@
 	char *body = NULL;
 	char * update_str;
 	
-	gaim_debug_info("MaYuan","Getting Contact List...\n");
+	purple_debug_info("MaYuan","Getting Contact List...\n");
 	if(update_time != NULL){
-		gaim_debug_info("MSNCL","last update time:{%s}\n",update_time);
+		purple_debug_info("MSNCL","last update time:{%s}\n",update_time);
 		update_str = g_strdup_printf(MSN_GET_CONTACT_UPDATE_XML,update_time);
 	}else{
 		update_str = g_strdup("");
@@ -294,29 +294,29 @@
 	char *group_name,*group_id;
 
 	session = contact->session;
-	gaim_debug_misc("xml","parse addressbook:{%s}\nsize:%d\n",contact->soapconn->body,contact->soapconn->body_len);
+	purple_debug_misc("xml","parse addressbook:{%s}\nsize:%d\n",contact->soapconn->body,contact->soapconn->body_len);
 	node = 	xmlnode_from_str(contact->soapconn->body, contact->soapconn->body_len);
 
 	if(node == NULL){
-		gaim_debug_misc("xml","parse from str err!\n");
+		purple_debug_misc("xml","parse from str err!\n");
 		return FALSE;
 	}
-	gaim_debug_misc("xml","node{%p},name:%s,child:%s,last:%s\n",node,node->name,node->child->name,node->lastchild->name);
+	purple_debug_misc("xml","node{%p},name:%s,child:%s,last:%s\n",node,node->name,node->child->name,node->lastchild->name);
 	body = xmlnode_get_child(node,"Body");
-	gaim_debug_misc("xml","body{%p},name:%s\n",body,body->name);
+	purple_debug_misc("xml","body{%p},name:%s\n",body,body->name);
 	response = xmlnode_get_child(body,"ABFindAllResponse");
 
 	if (response == NULL) {
 		return FALSE;
 	}
 
-	gaim_debug_misc("xml","response{%p},name:%s\n",response,response->name);
+	purple_debug_misc("xml","response{%p},name:%s\n",response,response->name);
 	result =xmlnode_get_child(response,"ABFindAllResult");
 	if(result == NULL){
-		gaim_debug_misc("MSNAB","receive no address book update\n");
+		purple_debug_misc("MSNAB","receive no address book update\n");
 		return TRUE;
 	}
-	gaim_debug_misc("xml","result{%p},name:%s\n",result,result->name);
+	purple_debug_misc("xml","result{%p},name:%s\n",result,result->name);
 
 	/*Process Group List*/
 	groups =xmlnode_get_child(result,"groups");
@@ -335,11 +335,11 @@
 			continue;
 		}
 
-		gaim_debug_misc("MsnAB","group_id:%s name:%s\n",group_id,group_name);
-		if ((gaim_find_group(group_name)) == NULL){
-			GaimGroup *g = gaim_group_new(group_name);
-			gaim_blist_node_set_string(&(g->node),"groupId",group_id);
-			gaim_blist_add_group(g, NULL);
+		purple_debug_misc("MsnAB","group_id:%s name:%s\n",group_id,group_name);
+		if ((purple_find_group(group_name)) == NULL){
+			PurpleGroup *g = purple_group_new(group_name);
+			purple_blist_node_set_string(&(g->node),"groupId",group_id);
+			purple_blist_add_group(g, NULL);
 		}
 		g_free(group_id);
 		g_free(group_name);
@@ -349,10 +349,10 @@
 	group_name = g_strdup(MSN_INDIVIDUALS_GROUP_NAME);
 	msn_group_new(session->userlist,group_id , group_name);
 	if (group_id != NULL){
-		gaim_debug_misc("MsnAB","group_id:%s name:%s,value:%d\n",group_id,group_name,*group_name=='\0');
-		if ((gaim_find_group(group_name)) == NULL){
-			GaimGroup *g = gaim_group_new(group_name);
-			gaim_blist_add_group(g, NULL);
+		purple_debug_misc("MsnAB","group_id:%s name:%s,value:%d\n",group_id,group_name,*group_name=='\0');
+		if ((purple_find_group(group_name)) == NULL){
+			PurpleGroup *g = purple_group_new(group_name);
+			purple_blist_add_group(g, NULL);
 		}
 	}
 	g_free(group_name);
@@ -363,17 +363,17 @@
 	group_name = g_strdup(MSN_NON_IM_GROUP_NAME);
 	msn_group_new(session->userlist,group_id , group_name);
 	if (group_id != NULL){
-		gaim_debug_misc("MsnAB","group_id:%s name:%s,value:%d\n",group_id,group_name,*group_name=='\0');
-		if ((gaim_find_group(group_name)) == NULL){
-			GaimGroup *g = gaim_group_new(group_name);
-			gaim_blist_add_group(g, NULL);
+		purple_debug_misc("MsnAB","group_id:%s name:%s,value:%d\n",group_id,group_name,*group_name=='\0');
+		if ((purple_find_group(group_name)) == NULL){
+			PurpleGroup *g = purple_group_new(group_name);
+			purple_blist_add_group(g, NULL);
 		}
 	}
 	g_free(group_name);
 	g_free(group_id);
 
 	/*Process contact List*/
-	gaim_debug_info("MSNAB","process contact list...\n");
+	purple_debug_info("MSNAB","process contact list...\n");
 	contacts =xmlnode_get_child(result,"contacts");
 	for(contactNode = xmlnode_get_child(contacts, "Contact"); contactNode;
 				contactNode = xmlnode_get_next_twin(contactNode)){
@@ -393,7 +393,7 @@
 		if (!strcmp(type, "Me")){
 			char *friendly;
 			friendly = xmlnode_get_data(xmlnode_get_child(contactInfo, "displayName"));
-			gaim_connection_set_display_name(session->account->gc, gaim_url_decode(friendly));
+			purple_connection_set_display_name(session->account->gc, purple_url_decode(friendly));
 			g_free(friendly);
 		}
 
@@ -421,13 +421,13 @@
 					/*Messenger enabled, Get the Passport*/
 					emailNode = xmlnode_get_child(contactEmailNode,"email");
 					passport = xmlnode_get_data(emailNode);
-					gaim_debug_info("MsnAB","Yahoo User %s\n",passport);
+					purple_debug_info("MsnAB","Yahoo User %s\n",passport);
 					break;
 				}else{
-					/*TODO maybe we can just ignore it in Gaim?*/
+					/*TODO maybe we can just ignore it in Purple?*/
 					emailNode = xmlnode_get_child(contactEmailNode,"email");
 					passport = xmlnode_get_data(emailNode);
-					gaim_debug_info("MSNAB","Other type user\n");
+					purple_debug_info("MSNAB","Other type user\n");
 				}
 				g_free(msnEnabled);
 			}
@@ -446,7 +446,7 @@
 			Name =xmlnode_get_data(displayName);	
 		}
 
-		gaim_debug_misc("MsnAB","passport:{%s} uid:{%s} display:{%s}\n",
+		purple_debug_misc("MsnAB","passport:{%s} uid:{%s} display:{%s}\n",
 						passport,uid,Name);
 
 		user = msn_userlist_find_add_user(session->userlist, passport,Name);
@@ -458,14 +458,14 @@
 		g_free(uid);
 		g_free(type);
 
-		gaim_debug_misc("MsnAB","parse guid...\n");
+		purple_debug_misc("MsnAB","parse guid...\n");
 		groupIds = xmlnode_get_child(contactInfo,"groupIds");
 		if(groupIds){
 			for(guid = xmlnode_get_child(groupIds, "guid");guid;
 							guid = xmlnode_get_next_twin(guid)){
 				group_id = xmlnode_get_data(guid);
 				msn_user_add_group_id(user,group_id);
-				gaim_debug_misc("MsnAB","guid:%s\n",group_id);
+				purple_debug_misc("MsnAB","guid:%s\n",group_id);
 				g_free(group_id);
 			}
 		}else{
@@ -483,13 +483,13 @@
 
 		LastChangeNode = xmlnode_get_child(abNode,"lastChange");
 		lastchange = xmlnode_get_data(LastChangeNode);
-		gaim_debug_info("MsnAB"," lastchanged Time:{%s}\n",lastchange);
-		gaim_blist_node_set_string(msn_session_get_bnode(contact->session),"ablastChange",lastchange);
+		purple_debug_info("MsnAB"," lastchanged Time:{%s}\n",lastchange);
+		purple_blist_node_set_string(msn_session_get_bnode(contact->session),"ablastChange",lastchange);
 		
 		DynamicItemLastChangedNode = xmlnode_get_child(abNode,"DynamicItemLastChanged");
 		dynamicChange = xmlnode_get_data(DynamicItemLastChangedNode);
-		gaim_debug_info("MsnAB"," DynamicItemLastChanged :{%s}\n",dynamicChange);
-		gaim_blist_node_set_string(msn_session_get_bnode(contact->session),"DynamicItemLastChanged",lastchange);
+		purple_debug_info("MsnAB"," DynamicItemLastChanged :{%s}\n",dynamicChange);
+		purple_blist_node_set_string(msn_session_get_bnode(contact->session),"DynamicItemLastChanged",lastchange);
 	}
 
 	xmlnode_free(node);
@@ -498,7 +498,7 @@
 }
 
 static void
-msn_get_address_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_get_address_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 	MsnContact *contact;
@@ -509,7 +509,7 @@
 	session = soapconn->session;
 	g_return_if_fail(session != NULL);
 
-//	gaim_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf);
+//	purple_debug_misc("msn", "soap contact server Reply: {%s}\n", soapconn->read_buf);
 	if (msn_parse_addressbook(contact)) {
 		msn_notification_dump_contact(session);
 		msn_set_psm(session);
@@ -524,11 +524,11 @@
 
 /**/
 static void
-msn_address_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_address_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","finish contact written\n");
+	purple_debug_info("MaYuan","finish contact written\n");
 	soapconn->read_cb = msn_get_address_cb;
 }
 
@@ -540,7 +540,7 @@
 	char *body = NULL;
 	char *ab_update_str,*update_str;
 
-	gaim_debug_info("MaYuan","msn_get_address_book()...\n");
+	purple_debug_info("MaYuan","msn_get_address_book()...\n");
 	/*build SOAP and POST it*/
 	if(LastChanged != NULL){
 		ab_update_str = g_strdup_printf(MSN_GET_ADDRESS_UPDATE_XML,LastChanged);
@@ -567,17 +567,17 @@
 }
 
 static void
-msn_add_contact_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_add_contact_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	gaim_debug_info("MaYuan","add contact read done\n");
+	purple_debug_info("MaYuan","add contact read done\n");
 }
 
 static void
-msn_add_contact_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_add_contact_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","finish add contact  written\n");
+	purple_debug_info("MaYuan","finish add contact  written\n");
 	soapconn->read_cb = msn_add_contact_read_cb;
 //	msn_soap_read_cb(data,source,cond);
 }
@@ -591,7 +591,7 @@
 	char *contact_xml = NULL;
 	char *soap_action;
 
-	gaim_debug_info("MaYuan","msn add a contact...\n");
+	purple_debug_info("MaYuan","msn add a contact...\n");
 	contact_xml = g_strdup_printf(MSN_CONTACT_XML,passport);
 	if(groupId == NULL){
 		body = g_strdup_printf(MSN_ADD_CONTACT_TEMPLATE,contact_xml);
@@ -616,17 +616,17 @@
 }
 
 static void
-msn_delete_contact_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_delete_contact_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	gaim_debug_info("MaYuan","delete contact read done\n");
+	purple_debug_info("MaYuan","delete contact read done\n");
 }
 
 static void
-msn_delete_contact_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_delete_contact_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","delete contact written\n");
+	purple_debug_info("MaYuan","delete contact written\n");
 	soapconn->read_cb = msn_delete_contact_read_cb;
 //	msn_soap_read_cb(data,source,cond);
 }
@@ -640,7 +640,7 @@
 	MsnSoapReq *soap_request;
 
 	g_return_if_fail(contactId != NULL);
-	gaim_debug_info("MaYuan","msn delete a contact,contactId:{%s}...\n",contactId);
+	purple_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);
 	g_free(contact_xml);
@@ -656,17 +656,17 @@
 }
 
 static void
-msn_update_contact_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_update_contact_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	gaim_debug_info("MaYuan","update contact read done\n");
+	purple_debug_info("MaYuan","update contact read done\n");
 }
 
 static void
-msn_update_contact_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_update_contact_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","update contact written\n");
+	purple_debug_info("MaYuan","update contact written\n");
 	soapconn->read_cb = msn_update_contact_read_cb;
 //	msn_soap_read_cb(data,source,cond);
 }
@@ -679,7 +679,7 @@
 	MsnSoapReq *soap_request;
 	char *body = NULL;
 
-	gaim_debug_info("MaYuan","msn unblock a contact...\n");
+	purple_debug_info("MaYuan","msn unblock a contact...\n");
 
 	body = g_strdup_printf(MSN_CONTACT_UPDATE_TEMPLATE,nickname);
 	/*build SOAP and POST it*/
@@ -695,17 +695,17 @@
 #endif
 
 static void
-msn_block_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_block_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	gaim_debug_info("MaYuan","block read done\n");
+	purple_debug_info("MaYuan","block read done\n");
 }
 
 static void
-msn_block_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_block_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","finish unblock written\n");
+	purple_debug_info("MaYuan","finish unblock written\n");
 	soapconn->read_cb = msn_block_read_cb;
 }
 
@@ -716,7 +716,7 @@
 	MsnSoapReq *soap_request;
 	char *body = NULL;
 
-	gaim_debug_info("MaYuan","msn block a contact...\n");
+	purple_debug_info("MaYuan","msn block a contact...\n");
 	body = g_strdup_printf(MSN_CONTACT_DELECT_FROM_ALLOW_TEMPLATE,membership_id);
 	/*build SOAP and POST it*/
 	soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
@@ -730,17 +730,17 @@
 }
 
 static void
-msn_unblock_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_unblock_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	gaim_debug_info("MaYuan","unblock read done\n");
+	purple_debug_info("MaYuan","unblock read done\n");
 }
 
 static void
-msn_unblock_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_unblock_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","finish unblock written\n");
+	purple_debug_info("MaYuan","finish unblock written\n");
 	soapconn->read_cb = msn_unblock_read_cb;
 }
 
@@ -751,7 +751,7 @@
 	MsnSoapReq *soap_request;
 	char *body = NULL;
 
-	gaim_debug_info("MaYuan","msn unblock a contact...\n");
+	purple_debug_info("MaYuan","msn unblock a contact...\n");
 
 	body = g_strdup_printf(MSN_UNBLOCK_CONTACT_TEMPLATE,passport);
 	/*build SOAP and POST it*/
@@ -766,17 +766,17 @@
 }
 
 static void
-msn_gleams_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_gleams_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	gaim_debug_info("MaYuan","Gleams read done\n");
+	purple_debug_info("MaYuan","Gleams read done\n");
 }
 
 static void
-msn_gleams_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_gleams_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","finish Group written\n");
+	purple_debug_info("MaYuan","finish Group written\n");
 	soapconn->read_cb = msn_gleams_read_cb;
 //	msn_soap_read_cb(data,source,cond);
 }
@@ -788,7 +788,7 @@
 {
 	MsnSoapReq *soap_request;
 
-	gaim_debug_info("MaYuan","msn get gleams info...\n");
+	purple_debug_info("MaYuan","msn get gleams info...\n");
 	/*build SOAP and POST it*/
 	soap_request = msn_soap_request_new(MSN_CONTACT_SERVER,
 					MSN_ADDRESS_BOOK_POST_URL,MSN_GET_GLEAMS_SOAP_ACTION,
@@ -803,17 +803,17 @@
  * Group Operation
  ***************************************************************/
 static void
-msn_group_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_group_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
-	gaim_debug_info("MaYuan","Group read \n");
+	purple_debug_info("MaYuan","Group read \n");
 }
 
 static void
-msn_group_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_group_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","finish Group written\n");
+	purple_debug_info("MaYuan","finish Group written\n");
 	soapconn->read_cb = msn_group_read_cb;
 //	msn_soap_read_cb(data,source,cond);
 }
@@ -827,7 +827,7 @@
 
 	g_return_if_fail(session != NULL);
 	contact = session->contact;
-	gaim_debug_info("MaYuan","msn add group...\n");
+	purple_debug_info("MaYuan","msn add group...\n");
 
 	body = g_strdup_printf(MSN_GROUP_ADD_TEMPLATE,group_name);
 	/*build SOAP and POST it*/
@@ -852,7 +852,7 @@
 	 */
 	g_return_if_fail(guid != NULL);
 	contact = session->contact;
-	gaim_debug_info("MaYuan","msn del group...\n");
+	purple_debug_info("MaYuan","msn del group...\n");
 
 	body = g_strdup_printf(MSN_GROUP_DEL_TEMPLATE,guid);
 	/*build SOAP and POST it*/
@@ -870,7 +870,7 @@
 msn_contact_connect_init(MsnSoapConn *soapconn)
 {
 	/*  Authenticate via Windows Live ID. */
-	gaim_debug_info("MaYuan","msn_contact_connect...\n");
+	purple_debug_info("MaYuan","msn_contact_connect...\n");
 
 	msn_soap_init(soapconn,MSN_CONTACT_SERVER,1,
 					msn_contact_login_connect_cb,
--- a/libpurple/protocols/msn/contact.h	Sun Apr 15 05:00:56 2007 +0000
+++ b/libpurple/protocols/msn/contact.h	Sun Apr 15 05:01:55 2007 +0000
@@ -2,9 +2,9 @@
  * @file contact.h			Header file for contact.c
  *	Author
  * 		MaYuan<mayuan2006@gmail.com>
- * gaim
+ * purple
  *
- * Gaim is the legal property of its developers, whose names are too numerous
+ * Purple is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
  *
--- a/libpurple/protocols/msn/oim.c	Sun Apr 15 05:00:56 2007 +0000
+++ b/libpurple/protocols/msn/oim.c	Sun Apr 15 05:01:55 2007 +0000
@@ -3,9 +3,9 @@
  * 	get and send MSN offline Instant Message via SOAP request
  *	Author
  * 		MaYuan<mayuan2006@gmail.com>
- * gaim
+ * purple
  *
- * Gaim is the legal property of its developers, whose names are too numerous
+ * Purple is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
  *
@@ -68,7 +68,7 @@
 {
 	MsnOimSendReq *request;
 	
-	gaim_debug_info("OIM","destroy the OIM \n");
+	purple_debug_info("OIM","destroy the OIM \n");
 	msn_soap_destroy(oim->retrieveconn);
 	msn_soap_destroy(oim->sendconn);
 	g_free(oim->run_id);
@@ -120,9 +120,9 @@
 {
 	char *oim_body,*oim_base64;
 	
-	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);	
+	purple_debug_info("MaYuan","encode OIM Message...\n");	
+	oim_base64 = purple_base64_encode((const guchar *)body, strlen(body));
+	purple_debug_info("MaYuan","encoded base64 body:{%s}\n",oim_base64);	
 	oim_body = g_strdup_printf(MSN_OIM_MSG_TEMPLATE,
 				oim->run_id,oim->send_seq,oim_base64);
 
@@ -131,7 +131,7 @@
 
 /*oim SOAP server login error*/
 static void
-msn_oim_send_error_cb(GaimSslConnection *gsc, GaimSslErrorType error, void *data)
+msn_oim_send_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, void *data)
 {
 	MsnSoapConn *soapconn = data;
 	MsnSession *session;
@@ -144,8 +144,8 @@
 
 /*msn oim SOAP server connect process*/
 static void
-msn_oim_send_connect_cb(gpointer data, GaimSslConnection *gsc,
-				 GaimInputCondition cond)
+msn_oim_send_connect_cb(gpointer data, PurpleSslConnection *gsc,
+				 PurpleInputCondition cond)
 {
 	MsnSoapConn *soapconn = data;
 	MsnSession * session;
@@ -178,7 +178,7 @@
 		/*Send OK! return*/
 		MsnOimSendReq *request;
 		
-		gaim_debug_info("MaYuan","send OIM OK!");
+		purple_debug_info("MaYuan","send OIM OK!");
 		xmlnode_free(responseNode);
 		request = g_queue_pop_head(oim->send_queue);
 		msn_oim_free_send_req(request);
@@ -189,11 +189,11 @@
 	/*get the challenge,and repost it*/
 	faultCodeNode = xmlnode_get_child(faultNode,"faultcode");
 	if(faultCodeNode == NULL){
-		gaim_debug_info("MaYuan","faultcode Node is NULL\n");
+		purple_debug_info("MaYuan","faultcode Node is NULL\n");
 		goto oim_send_process_fail;
 	}
 	faultCodeStr = xmlnode_get_data(faultCodeNode);
-	gaim_debug_info("MaYuan","fault code:{%s}\n",faultCodeStr);
+	purple_debug_info("MaYuan","fault code:{%s}\n",faultCodeStr);
 
 	if(strcmp(faultCodeStr,"q0:AuthenticationFailed")){
 		/*other Fault Reason?*/
@@ -202,7 +202,7 @@
 
 	faultstringNode = xmlnode_get_child(faultNode,"faultstring");
 	faultstring = xmlnode_get_data(faultstringNode);
-	gaim_debug_info("MaYuan","fault string :{%s}\n",faultstring);
+	purple_debug_info("MaYuan","fault string :{%s}\n",faultstring);
 
 	/* lock key fault reason,
 	 * compute the challenge and resend it
@@ -215,10 +215,10 @@
 
 	g_free(oim->challenge);
 	oim->challenge = xmlnode_get_data(challengeNode);
-	gaim_debug_info("MaYuan","lockkey:{%s}\n",oim->challenge);
+	purple_debug_info("MaYuan","lockkey:{%s}\n",oim->challenge);
 
 	/*repost the send*/
-	gaim_debug_info("MaYuan","prepare to repost the send...\n");
+	purple_debug_info("MaYuan","prepare to repost the send...\n");
 	msn_oim_send_msg(oim);
 
 oim_send_process_fail:
@@ -227,8 +227,8 @@
 }
 
 static void
-msn_oim_send_read_cb(gpointer data, GaimSslConnection *gsc,
-				 GaimInputCondition cond)
+msn_oim_send_read_cb(gpointer data, PurpleSslConnection *gsc,
+				 PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;
 	MsnSession 	*session = soapconn->session;
@@ -238,12 +238,12 @@
 	oim = soapconn->session->oim;
 	g_return_if_fail(oim != NULL);
 
-	gaim_debug_info("MaYuan","read buffer:{%s}\n",soapconn->body);
+	purple_debug_info("MaYuan","read buffer:{%s}\n",soapconn->body);
 	msn_oim_send_process(oim,soapconn->body,soapconn->body_len);
 }
 
 static void
-msn_oim_send_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_oim_send_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
@@ -278,7 +278,7 @@
 	oim_request = g_queue_pop_head(oim->send_queue);
 	g_return_if_fail(oim_request != NULL);
 
-	gaim_debug_info("MaYuan","send single OIM Message\n");
+	purple_debug_info("MaYuan","send single OIM Message\n");
 	mspauth = g_strdup_printf("t=%s&amp;p=%s",
 		oim->session->passport_info.t,
 		oim->session->passport_info.p
@@ -291,10 +291,10 @@
 	if(oim->challenge != NULL){
 		msn_handle_chl(oim->challenge, buf);
 	}else{
-		gaim_debug_info("MaYuan","no lock key challenge,wait for SOAP Fault and Resend\n");
+		purple_debug_info("MaYuan","no lock key challenge,wait for SOAP Fault and Resend\n");
 		buf[0]='\0';
 	}
-	gaim_debug_info("MaYuan","get the lock key challenge {%s}\n",buf);	
+	purple_debug_info("MaYuan","get the lock key challenge {%s}\n",buf);	
 
 	msg_body = msn_oim_msg_to_str(oim, oim_request->oim_msg);
 	soap_body = g_strdup_printf(MSN_OIM_SEND_TEMPLATE,
@@ -327,12 +327,12 @@
  * OIM delete SOAP request
  * **************************************/
 static void
-msn_oim_delete_read_cb(gpointer data, GaimSslConnection *gsc,
-				 GaimInputCondition cond)
+msn_oim_delete_read_cb(gpointer data, PurpleSslConnection *gsc,
+				 PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
-	gaim_debug_info("MaYuan","OIM delete read buffer:{%s}\n",soapconn->body);
+	purple_debug_info("MaYuan","OIM delete read buffer:{%s}\n",soapconn->body);
 
 	msn_soap_free_read_buf(soapconn);
 	/*get next single Offline Message*/
@@ -340,7 +340,7 @@
 }
 
 static void
-msn_oim_delete_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_oim_delete_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
@@ -357,7 +357,7 @@
 	g_return_if_fail(oim != NULL);
 	g_return_if_fail(msgid != NULL);
 
-	gaim_debug_info("MaYuan","Delete single OIM Message {%s}\n",msgid);
+	purple_debug_info("MaYuan","Delete single OIM Message {%s}\n",msgid);
 	t = oim->session->passport_info.t;
 	p = oim->session->passport_info.p;
 
@@ -379,7 +379,7 @@
  * **************************************/
 /*oim SOAP server login error*/
 static void
-msn_oim_get_error_cb(GaimSslConnection *gsc, GaimSslErrorType error, void *data)
+msn_oim_get_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, void *data)
 {
 	MsnSoapConn *soapconn = data;
 	MsnSession *session;
@@ -393,8 +393,8 @@
 
 /*msn oim SOAP server connect process*/
 static void
-msn_oim_get_connect_cb(gpointer data, GaimSslConnection *gsc,
-				 GaimInputCondition cond)
+msn_oim_get_connect_cb(gpointer data, PurpleSslConnection *gsc,
+				 PurpleInputCondition cond)
 {
 	MsnSoapConn *soapconn = data;
 	MsnSession * session;
@@ -406,7 +406,7 @@
 	session = oim->session;
 	g_return_if_fail(session != NULL);
 
-	gaim_debug_info("MaYuan","oim get SOAP Server connected!\n");
+	purple_debug_info("MaYuan","oim get SOAP Server connected!\n");
 }
 
 /*Post the Offline Instant Message to User Conversation*/
@@ -426,8 +426,8 @@
 
 	msn_message_parse_payload(message, msg_str, strlen(msg_str),
 							  MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM);
-	gaim_debug_info("MaYuan","oim body:{%s}\n",message->body);
-	decode_msg = gaim_base64_decode(message->body,&body_len);
+	purple_debug_info("MaYuan","oim body:{%s}\n",message->body);
+	decode_msg = purple_base64_decode(message->body,&body_len);
 	date =	(char *)g_hash_table_lookup(message->attr_table, "Date");
 	from =	(char *)g_hash_table_lookup(message->attr_table, "From");
 	if(strstr(from," ")){
@@ -436,12 +436,12 @@
 	if(has_nick){
 		tokens = g_strsplit(from , " " , 2);
 		passport_str = g_strdup(tokens[1]);
-		gaim_debug_info("MaYuan","oim Date:{%s},nickname:{%s},tokens[1]:{%s} passport{%s}\n",
+		purple_debug_info("MaYuan","oim Date:{%s},nickname:{%s},tokens[1]:{%s} passport{%s}\n",
 							date,tokens[0],tokens[1],passport_str);
 		g_strfreev(tokens);
 	}else{
 		passport_str = g_strdup(from);
-		gaim_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",
+		purple_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",
 					date,passport_str);
 	}
 	start = strstr(passport_str,"<");
@@ -449,9 +449,9 @@
 	end = strstr(passport_str,">");
 	passport = g_strndup(start,end - start);
 	g_free(passport_str);
-	gaim_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",date,passport);
+	purple_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",date,passport);
 
-	msn_session_report_user(oim->session,passport,decode_msg,GAIM_MESSAGE_SYSTEM);
+	msn_session_report_user(oim->session,passport,decode_msg,PURPLE_MESSAGE_SYSTEM);
 
 	/*Now get the oim message ID from the oim_list.
 	 * and append to read list to prepare for deleting the Offline Message when sign out
@@ -482,20 +482,20 @@
 	msg_data = xmlnode_get_data(msgNode);
 	msg_str = g_strdup(msg_data);
 	g_free(msg_data);
-	gaim_debug_info("OIM","msg:{%s}\n",msg_str);
+	purple_debug_info("OIM","msg:{%s}\n",msg_str);
 	msn_oim_report_to_user(oim,msg_str);
 
 	g_free(msg_str);
 }
 
 static void
-msn_oim_get_read_cb(gpointer data, GaimSslConnection *gsc,
-				 GaimInputCondition cond)
+msn_oim_get_read_cb(gpointer data, PurpleSslConnection *gsc,
+				 PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 	MsnOim * oim = soapconn->session->oim;
 
-	gaim_debug_info("MaYuan","OIM get read buffer:{%s}\n",soapconn->body);
+	purple_debug_info("MaYuan","OIM get read buffer:{%s}\n",soapconn->body);
 
 	/*we need to process the read message!*/
 	msn_oim_get_process(oim,soapconn->body);
@@ -506,7 +506,7 @@
 }
 
 static void
-msn_oim_get_written_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_oim_get_written_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn = data;	
 
@@ -539,7 +539,7 @@
 		rtNode = xmlnode_get_child(mNode,"RT");
 		if(rtNode != NULL)
 			rTime = xmlnode_get_data(rtNode);
-/*		gaim_debug_info("MaYuan","E:{%s},I:{%s},rTime:{%s}\n",passport,msgid,rTime);*/
+/*		purple_debug_info("MaYuan","E:{%s},I:{%s},rTime:{%s}\n",passport,msgid,rTime);*/
 
 		oim->oim_list = g_list_append(oim->oim_list,msgid);
 		msn_oim_post_single_get_msg(oim,msgid);
@@ -557,7 +557,7 @@
 	MsnSoapReq *soap_request;
 	const char *soap_body,*t,*p;
 
-	gaim_debug_info("MaYuan","Get single OIM Message\n");
+	purple_debug_info("MaYuan","Get single OIM Message\n");
 	t = oim->session->passport_info.t;
 	p = oim->session->passport_info.p;
 
@@ -578,7 +578,7 @@
 static void
 msn_oim_retrieve_connect_init(MsnSoapConn *soapconn)
 {
-	gaim_debug_info("MaYuan","msn_oim_connect...\n");
+	purple_debug_info("MaYuan","msn_oim_connect...\n");
 	msn_soap_init(soapconn,MSN_OIM_RETRIEVE_HOST,1,
 					msn_oim_get_connect_cb,
 					msn_oim_get_error_cb);
@@ -588,7 +588,7 @@
 static void
 msn_oim_send_connect_init(MsnSoapConn *sendconn)
 {
-	gaim_debug_info("MaYuan","msn oim send connect init...\n");
+	purple_debug_info("MaYuan","msn oim send connect init...\n");
 	msn_soap_init(sendconn,MSN_OIM_SEND_HOST,1,
 					msn_oim_send_connect_cb,
 					msn_oim_send_error_cb);
--- a/libpurple/protocols/msn/oim.h	Sun Apr 15 05:00:56 2007 +0000
+++ b/libpurple/protocols/msn/oim.h	Sun Apr 15 05:01:55 2007 +0000
@@ -2,9 +2,9 @@
  * @file oim.h			Header file for oim.c
  *	Author
  * 		MaYuan<mayuan2006@gmail.com>
- * gaim
+ * purple
  *
- * Gaim is the legal property of its developers, whose names are too numerous
+ * Purple is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
  *
--- a/libpurple/protocols/msn/soap.c	Sun Apr 15 05:00:56 2007 +0000
+++ b/libpurple/protocols/msn/soap.c	Sun Apr 15 05:01:55 2007 +0000
@@ -3,9 +3,9 @@
  * 	SOAP connection related process
  *	Author
  * 		MaYuan<mayuan2006@gmail.com>
- * gaim
+ * purple
  *
- * Gaim is the legal property of its developers, whose names are too numerous
+ * Purple is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
  *
@@ -62,13 +62,13 @@
 
 /*ssl soap connect callback*/
 void
-msn_soap_connect_cb(gpointer data, GaimSslConnection *gsc,
-				 GaimInputCondition cond)
+msn_soap_connect_cb(gpointer data, PurpleSslConnection *gsc,
+				 PurpleInputCondition cond)
 {
 	MsnSoapConn * soapconn;
 	MsnSession *session;
 
-	gaim_debug_info("MaYuan","Soap connection connected!\n");
+	purple_debug_info("MaYuan","Soap connection connected!\n");
 	soapconn = data;
 	g_return_if_fail(soapconn != NULL);
 
@@ -89,12 +89,12 @@
 
 /*ssl soap error callback*/
 static void
-msn_soap_error_cb(GaimSslConnection *gsc, GaimSslErrorType error, void *data)
+msn_soap_error_cb(PurpleSslConnection *gsc, PurpleSslErrorType error, void *data)
 {	
 	MsnSoapConn * soapconn = data;
 
 	g_return_if_fail(data != NULL);
-	gaim_debug_info("MaYuan","Soap connection error!\n");
+	purple_debug_info("MaYuan","Soap connection error!\n");
 	msn_soap_set_process_step(soapconn, MSN_SOAP_UNCONNECTED);
 
 	/*error callback*/
@@ -106,10 +106,10 @@
 /*init the soap connection*/
 void
 msn_soap_init(MsnSoapConn *soapconn,char * host,int ssl,
-				GaimSslInputFunction	connect_cb,
-				GaimSslErrorFunction	error_cb)
+				PurpleSslInputFunction	connect_cb,
+				PurpleSslErrorFunction	error_cb)
 {
-	gaim_debug_info("MaYuan","msn_soap_init...\n");
+	purple_debug_info("MaYuan","msn_soap_init...\n");
 	soapconn->login_host = g_strdup(host);
 	soapconn->ssl_conn = ssl;
 	soapconn->connect_cb = connect_cb;
@@ -121,8 +121,8 @@
 msn_soap_connect(MsnSoapConn *soapconn)
 {
 	if(soapconn->ssl_conn){
-		gaim_ssl_connect(soapconn->session->account, soapconn->login_host,
-				GAIM_SSL_DEFAULT_PORT, msn_soap_connect_cb, msn_soap_error_cb,
+		purple_ssl_connect(soapconn->session->account, soapconn->login_host,
+				PURPLE_SSL_DEFAULT_PORT, msn_soap_connect_cb, msn_soap_error_cb,
 				soapconn);
 	}else{
 	}
@@ -135,7 +135,7 @@
 {
 	if(soapconn->ssl_conn){
 		if(soapconn->gsc != NULL){
-			gaim_ssl_close(soapconn->gsc);
+			purple_ssl_close(soapconn->gsc);
 			soapconn->gsc = NULL;
 		}
 	}else{
@@ -168,11 +168,11 @@
 
 	/*remove the write handler*/
 	if (soapconn->output_handler > 0){
-		gaim_input_remove(soapconn->output_handler);
+		purple_input_remove(soapconn->output_handler);
 	}
 	/*remove the read handler*/
 	if (soapconn->input_handler > 0){
-		gaim_input_remove(soapconn->input_handler);
+		purple_input_remove(soapconn->input_handler);
 	}
 	msn_soap_free_read_buf(soapconn);
 	msn_soap_free_write_buf(soapconn);
@@ -209,7 +209,7 @@
 //	requested_len = (soapconn->need_to_read > 0) ? soapconn->need_to_read : MSN_SOAP_READ_BUFF_SIZE;
 	requested_len = MSN_SOAP_READ_BUFF_SIZE;
 	if(soapconn->ssl_conn){
-		len = gaim_ssl_read(soapconn->gsc, temp_buf,requested_len);
+		len = purple_ssl_read(soapconn->gsc, temp_buf,requested_len);
 	}else{
 		len = read(soapconn->fd, temp_buf,requested_len);
 	}
@@ -221,15 +221,15 @@
 		soapconn->read_buf[soapconn->read_len] = '\0';
 	}
 #ifdef MSN_SOAP_DEBUG
-	gaim_debug_info("MaYuan","++soap ssl read:{%d}\n",len);
-	gaim_debug_info("MaYuan","nexus ssl read:{%s}\n",soapconn->read_buf);
+	purple_debug_info("MaYuan","++soap ssl read:{%d}\n",len);
+	purple_debug_info("MaYuan","nexus ssl read:{%s}\n",soapconn->read_buf);
 #endif
 	return len;
 }
 
 /*read the whole SOAP server response*/
 void 
-msn_soap_read_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_soap_read_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn *soapconn = data;
 	MsnSession *session;
@@ -237,13 +237,13 @@
 	char * body_start,*body_len;
 	char *length_start,*length_end;
 
-//	gaim_debug_misc("MaYuan", "soap read cb\n");
+//	purple_debug_misc("MaYuan", "soap read cb\n");
 	session = soapconn->session;
 	g_return_if_fail(session != NULL);
 
 	if (soapconn->input_handler == -1){
-		soapconn->input_handler = gaim_input_add(soapconn->gsc->fd,
-			GAIM_INPUT_READ, msn_soap_read_cb, soapconn);
+		soapconn->input_handler = purple_input_add(soapconn->gsc->fd,
+			PURPLE_INPUT_READ, msn_soap_read_cb, soapconn);
 	}
 
 	/*read the request header*/
@@ -251,8 +251,8 @@
 	if (len < 0 && errno == EAGAIN){
 		return;
 	}else if (len < 0) {
-		gaim_debug_error("msn", "read Error!len:%d\n",len);
-		gaim_input_remove(soapconn->input_handler);
+		purple_debug_error("msn", "read Error!len:%d\n",len);
+		purple_input_remove(soapconn->input_handler);
 		soapconn->input_handler = -1;
 		g_free(soapconn->read_buf);
 		soapconn->read_buf = NULL;
@@ -270,7 +270,7 @@
 		/* Redirect. */
 		char *location, *c;
 
-		gaim_debug_error("MaYuan", "soap redirect\n");
+		purple_debug_error("MaYuan", "soap redirect\n");
 		location = strstr(soapconn->read_buf, "Location: ");
 		if (location == NULL)
 		{
@@ -298,15 +298,15 @@
 		g_free(soapconn->login_host);
 		soapconn->login_host = g_strdup(location);
 
-		gaim_ssl_connect(session->account, soapconn->login_host,
-			GAIM_SSL_DEFAULT_PORT, msn_soap_connect_cb,
+		purple_ssl_connect(session->account, soapconn->login_host,
+			PURPLE_SSL_DEFAULT_PORT, msn_soap_connect_cb,
 			msn_soap_error_cb, soapconn);
 	}
 	else if (strstr(soapconn->read_buf, "HTTP/1.1 401 Unauthorized") != NULL)
 	{
 		const char *error;
 
-		gaim_debug_error("MaYuan", "soap 401\n");
+		purple_debug_error("MaYuan", "soap 401\n");
 		if ((error = strstr(soapconn->read_buf, "WWW-Authenticate")) != NULL)
 		{
 			if ((error = strstr(error, "cbtxt=")) != NULL)
@@ -320,7 +320,7 @@
 					c = error + strlen(error);
 
 				temp = g_strndup(error, c - error);
-				error = gaim_url_decode(temp);
+				error = purple_url_decode(temp);
 				g_free(temp);
 			}
 		}
@@ -337,7 +337,7 @@
 			}
 			body_start += 4;
 
-			//	gaim_debug_misc("msn", "Soap Read: {%s}\n", soapconn->read_buf);
+			//	purple_debug_misc("msn", "Soap Read: {%s}\n", soapconn->read_buf);
 
 			/* we read the content-length*/
 			length_start = strstr(soapconn->read_buf, "Content-Length: ");
@@ -349,7 +349,7 @@
 			soapconn->body		= body_start;
 			soapconn->body_len	= atoi(body_len);
 #ifdef MSN_SOAP_DEBUG
-			gaim_debug_misc("MaYuan","SOAP Read length :%d,body len:%d\n",soapconn->read_len,soapconn->body_len);
+			purple_debug_misc("MaYuan","SOAP Read length :%d,body len:%d\n",soapconn->read_len,soapconn->body_len);
 #endif
 			soapconn->need_to_read = (body_start - soapconn->read_buf +soapconn->body_len) - soapconn->read_len;
 			if(soapconn->need_to_read >0){
@@ -358,7 +358,7 @@
 			g_free(body_len);
 
 			/*remove the read handler*/
-			gaim_input_remove(soapconn->input_handler);
+			purple_input_remove(soapconn->input_handler);
 			soapconn->input_handler = -1;
 			/*
 			 * close the soap connection,if more soap request came,
@@ -402,15 +402,15 @@
 
 /*Soap write process func*/
 static void
-msn_soap_write_cb(gpointer data, gint source, GaimInputCondition cond)
+msn_soap_write_cb(gpointer data, gint source, PurpleInputCondition cond)
 {
 	MsnSoapConn *soapconn = data;
 	int len, total_len;
 
 	g_return_if_fail(soapconn != NULL);
 	if(soapconn->write_buf == NULL){
-		gaim_debug_error("MaYuan","soap buffer is NULL\n");
-		gaim_input_remove(soapconn->output_handler);
+		purple_debug_error("MaYuan","soap buffer is NULL\n");
+		purple_input_remove(soapconn->output_handler);
 		soapconn->output_handler = -1;
 		return;
 	}
@@ -419,7 +419,7 @@
 	/* 
 	 * write the content to SSL server,
 	 */
-	len = gaim_ssl_write(soapconn->gsc,
+	len = purple_ssl_write(soapconn->gsc,
 		soapconn->write_buf + soapconn->written_len,
 		total_len - soapconn->written_len);
 
@@ -427,7 +427,7 @@
 		return;
 	else if (len <= 0){
 		/*SSL write error!*/
-		gaim_input_remove(soapconn->output_handler);
+		purple_input_remove(soapconn->output_handler);
 		soapconn->output_handler = -1;
 		/* TODO: notify of the error */
 		return;
@@ -437,7 +437,7 @@
 	if (soapconn->written_len < total_len)
 		return;
 
-	gaim_input_remove(soapconn->output_handler);
+	purple_input_remove(soapconn->output_handler);
 	soapconn->output_handler = -1;
 
 	/*clear the write buff*/
@@ -455,7 +455,7 @@
 
 /*write the buffer to SOAP connection*/
 void
-msn_soap_write(MsnSoapConn * soapconn, char *write_buf, GaimInputFunction written_cb)
+msn_soap_write(MsnSoapConn * soapconn, char *write_buf, PurpleInputFunction written_cb)
 {
 	soapconn->write_buf = write_buf;
 	soapconn->written_len = 0;
@@ -463,16 +463,16 @@
 
 	/*clear the read buffer first*/
 	/*start the write*/
-	soapconn->output_handler = gaim_input_add(soapconn->gsc->fd, GAIM_INPUT_WRITE,
+	soapconn->output_handler = purple_input_add(soapconn->gsc->fd, PURPLE_INPUT_WRITE,
 													msn_soap_write_cb, soapconn);
-	msn_soap_write_cb(soapconn, soapconn->gsc->fd, GAIM_INPUT_WRITE);
+	msn_soap_write_cb(soapconn, soapconn->gsc->fd, PURPLE_INPUT_WRITE);
 }
 
 /* New a soap request*/
 MsnSoapReq *
 msn_soap_request_new(const char *host,const char *post_url,const char *soap_action,
 				const char *body,
-				GaimInputFunction read_cb,GaimInputFunction written_cb)
+				PurpleInputFunction read_cb,PurpleInputFunction written_cb)
 {
 	MsnSoapReq *request;
 
@@ -533,12 +533,12 @@
 	if(!msn_soap_connected(soapconn)&&(soapconn->step == MSN_SOAP_UNCONNECTED)
 					&&(!g_queue_is_empty(soapconn->soap_queue))){
 		/*not connected?and we have something to process connect it first*/
-		gaim_debug_info("Ma Yuan","soap is not connected!\n");
+		purple_debug_info("Ma Yuan","soap is not connected!\n");
 		msn_soap_init_func(soapconn);
 		msn_soap_connect(soapconn);
 		return;
 	}
-	gaim_debug_info("Ma Yuan","soap  connected!\n");
+	purple_debug_info("Ma Yuan","soap  connected!\n");
 
 	/*if connected, what we only needed to do is to queue the request, 
 	 * when SOAP request in the queue processed done, will do this command.
@@ -559,7 +559,7 @@
 	char * soap_head = NULL;
 	char * request_str = NULL;
 
-	gaim_debug_info("MaYuan","msn_soap_post_request()...\n");
+	purple_debug_info("MaYuan","msn_soap_post_request()...\n");
 	msn_soap_set_process_step(soapconn,MSN_SOAP_PROCESSING);
 	soap_head = g_strdup_printf(
 					"POST %s HTTP/1.1\r\n"
@@ -582,7 +582,7 @@
 	g_free(soap_head);
 
 #ifdef MSN_SOAP_DEBUG
-	gaim_debug_info("MaYuan","send to  server{%s}\n",request_str);
+	purple_debug_info("MaYuan","send to  server{%s}\n",request_str);
 #endif
 
 	/*free read buffer*/
--- a/libpurple/protocols/msn/soap.h	Sun Apr 15 05:00:56 2007 +0000
+++ b/libpurple/protocols/msn/soap.h	Sun Apr 15 05:01:55 2007 +0000
@@ -3,9 +3,9 @@
  * 	header file for SOAP connection related process
  *	Author
  * 		MaYuan<mayuan2006@gmail.com>
- * gaim
+ * purple
  *
- * Gaim is the legal property of its developers, whose names are too numerous
+ * Purple is the legal property of its developers, whose names are too numerous
  * to list here.  Please refer to the COPYRIGHT file distributed with this
  * source distribution.
  *
@@ -55,8 +55,8 @@
 
 	char *body;
 
-	GaimInputFunction read_cb;
-	GaimInputFunction written_cb;
+	PurpleInputFunction read_cb;
+	PurpleInputFunction written_cb;
 };
 
 struct _MsnSoapConn{
@@ -73,11 +73,11 @@
 	/*normal connection*/
 	guint	fd;
 	/*SSL connection*/
-	GaimSslConnection *gsc;
+	PurpleSslConnection *gsc;
 	/*ssl connection callback*/
-	GaimSslInputFunction	connect_cb;
+	PurpleSslInputFunction	connect_cb;
 	/*ssl error callback*/
-	GaimSslErrorFunction	error_cb;
+	PurpleSslErrorFunction	error_cb;
 
 	/*read handler*/
 	guint input_handler;
@@ -91,13 +91,13 @@
 	/*write buffer*/
 	char *write_buf;
 	gsize written_len;
-	GaimInputFunction written_cb;
+	PurpleInputFunction written_cb;
 
 	/*read buffer*/
 	char *read_buf;
 	gsize read_len;
 	gsize need_to_read;
-	GaimInputFunction read_cb;
+	PurpleInputFunction read_cb;
 
 	/*HTTP reply body part*/
 	char *body;
@@ -108,8 +108,8 @@
 /*Soap Request Function */
 MsnSoapReq *msn_soap_request_new(const char *host, const char *post_url,
 								 const char *soap_action, const char *body,
-								 GaimInputFunction read_cb,
-								 GaimInputFunction written_cb);
+								 PurpleInputFunction read_cb,
+								 PurpleInputFunction written_cb);
 
 void msn_soap_request_free(MsnSoapReq *request);
 void msn_soap_post_request(MsnSoapConn *soapconn,MsnSoapReq *request);
@@ -122,18 +122,18 @@
 void msn_soap_destroy(MsnSoapConn *soapconn);
 
 /*init a soap conneciton */
-void msn_soap_init(MsnSoapConn *soapconn,char * host,int ssl,GaimSslInputFunction connect_cb,GaimSslErrorFunction error_cb);
+void msn_soap_init(MsnSoapConn *soapconn,char * host,int ssl,PurpleSslInputFunction connect_cb,PurpleSslErrorFunction error_cb);
 void msn_soap_connect(MsnSoapConn *soapconn);
 void msn_soap_close(MsnSoapConn *soapconn);
 
 /*write to soap*/
-void msn_soap_write(MsnSoapConn * soapconn, char *write_buf, GaimInputFunction written_cb);
+void msn_soap_write(MsnSoapConn * soapconn, char *write_buf, PurpleInputFunction written_cb);
 void msn_soap_post(MsnSoapConn *soapconn,MsnSoapReq *request,MsnSoapConnectInitFunction msn_soap_init_func);
 
 void  msn_soap_free_read_buf(MsnSoapConn *soapconn);
 void msn_soap_free_write_buf(MsnSoapConn *soapconn);
-void msn_soap_connect_cb(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond);
-void msn_soap_read_cb(gpointer data, gint source, GaimInputCondition cond);
+void msn_soap_connect_cb(gpointer data, PurpleSslConnection *gsc, PurpleInputCondition cond);
+void msn_soap_read_cb(gpointer data, gint source, PurpleInputCondition cond);
 
 /*clean the unhandled request*/
 void msn_soap_clean_unhandled_request(MsnSoapConn *soapconn);