pidgin: 3b7b0dea: Remove calls to g_markup_escape_text. No...

qulogic at pidgin.im qulogic at pidgin.im
Fri Aug 15 01:32:29 EDT 2008


-----------------------------------------------------------------
Revision: 3b7b0deadf583b8df122dced7a6925e693af3223
Ancestor: 6ea703690eaaa2c3040acbe3864f3cc8421667d0
Author: qulogic at pidgin.im
Date: 2008-08-15T04:27:42
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3b7b0deadf583b8df122dced7a6925e693af3223

Modified files:
        libpurple/protocols/msn/contact.c
        libpurple/protocols/msn/msn.c libpurple/protocols/msn/page.c

ChangeLog: 

Remove calls to g_markup_escape_text. Not only does this help with old 
GLib compatibility, but some of these calls were wrong, too. It just never 
showed up because the code doesn't run yet.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/contact.c	a595e1136c24e79aeed249ea889ff1501dfc693b
+++ libpurple/protocols/msn/contact.c	74dcd9e76be5e13e3846fade00d5230d33262151
@@ -214,6 +214,7 @@ msn_create_address_book(MsnSession *sess
 msn_create_address_book(MsnSession *session)
 {
 	gchar *body;
+	gchar *token_str;
 
 	g_return_if_fail(session != NULL);
 	g_return_if_fail(session->user != NULL);
@@ -221,9 +222,11 @@ msn_create_address_book(MsnSession *sess
 	
 	purple_debug_info("msn", "Creating an Address Book.\n");
 
-	body = g_markup_printf_escaped(MSN_ADD_ADDRESSBOOK_TEMPLATE,
-		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS),
-		session->user->passport);
+	token_str = g_markup_escape_text(
+		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS), -1);
+	body = g_strdup_printf(MSN_ADD_ADDRESSBOOK_TEMPLATE,
+		token_str, session->user->passport);
+	g_free(token_str);
 
 	msn_soap_message_send(session,
 		msn_soap_message_new(MSN_ADD_ADDRESSBOOK_SOAP_ACTION,
@@ -398,6 +401,7 @@ msn_get_contact_list(MsnSession *session
 {
 	gchar *body = NULL;
 	gchar *update_str = NULL;
+	gchar *token_str;
 	GetContactListCbData cb_data = { session, partner_scenario };
 	const gchar *partner_scenario_str = MsnSoapPartnerScenarioText[partner_scenario];
 
@@ -405,12 +409,14 @@ msn_get_contact_list(MsnSession *session
 
 	if (update_time != NULL) {
 		purple_debug_info("msn", "CL Last update time: %s\n", update_time);
-		update_str = g_strdup_printf(MSN_GET_CONTACT_UPDATE_XML,update_time);
+		update_str = g_strdup_printf(MSN_GET_CONTACT_UPDATE_XML, update_time);
 	}
 
-	body = g_markup_printf_escaped(MSN_GET_CONTACT_TEMPLATE, partner_scenario_str,
-		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS),
-		update_str ? update_str : "");
+	token_str = g_markup_escape_text(
+		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS), -1);
+	body = g_strdup_printf(MSN_GET_CONTACT_TEMPLATE, partner_scenario_str,
+		token_str, update_str ? update_str : "");
+	g_free(token_str);
 
 	msn_soap_message_send(session,
 		msn_soap_message_new(MSN_GET_CONTACT_SOAP_ACTION,
@@ -798,6 +804,7 @@ msn_get_address_book(MsnSession *session
 	const char *dynamicItemLastChange)
 {
 	char *body, *update_str = NULL;
+	gchar *token_str;
 
 	purple_debug_misc("msn", "Getting Address Book\n");
 
@@ -807,10 +814,13 @@ msn_get_address_book(MsnSession *session
 	else if (LastChanged != NULL)
 		update_str = g_strdup_printf(MSN_GET_ADDRESS_UPDATE_XML, LastChanged);
 
-	body = g_markup_printf_escaped(MSN_GET_ADDRESS_TEMPLATE,
+	token_str = g_markup_escape_text(
+		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS), -1);
+	body = g_strdup_printf(MSN_GET_ADDRESS_TEMPLATE,
 		MsnSoapPartnerScenarioText[partner_scenario],
-		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS),
+		token_str,
 		update_str ? update_str : "");
+	g_free(token_str);
 
 	msn_soap_message_send(session,
 		msn_soap_message_new(MSN_GET_ADDRESS_SOAP_ACTION,
============================================================
--- libpurple/protocols/msn/msn.c	b9b7cd1cefd7fa9b552eac0f7f0c19a36d5fd27f
+++ libpurple/protocols/msn/msn.c	5ec6d0ec264cfbe749d3f8cf49961463ffb01d94
@@ -713,10 +713,16 @@ msn_tooltip_text(PurpleBuddy *buddy, Pur
 		if (name != NULL && *name) {
 			char *tmp2;
 
+			tmp2 = g_markup_escape_text(name, -1);
 			if (purple_presence_is_idle(presence)) {
-				tmp2 = g_markup_printf_escaped("%s/%s", name, _("Idle"));
-			} else {
-				tmp2 = g_markup_escape_text(name, -1);
+				char *idle;
+				char *tmp3;
+				/* Never know what those translations might end up like... */
+				idle = g_markup_escape_text(_("Idle"), -1);
+				tmp3 = g_strdup_printf("%s/%s", tmp2, idle);
+				g_free(idle);
+				g_free(tmp2);
+				tmp2 = tmp3;
 			}
 
 			if (psm != NULL && *psm) {
============================================================
--- libpurple/protocols/msn/page.c	87b3a90e5c7da3b501ec94a98e4de356a4772751
+++ libpurple/protocols/msn/page.c	ea4e9c550dcd213b5f3aaa8d6adc2047a00135b0
@@ -50,12 +50,15 @@ msn_page_gen_payload(const MsnPage *page
 msn_page_gen_payload(const MsnPage *page, size_t *ret_size)
 {
 	char *str;
+	char *body;
 
 	g_return_val_if_fail(page != NULL, NULL);
 
-	str = g_markup_printf_escaped(
+	body = g_markup_escape_text(msn_page_get_body(page), -1);
+	str = g_strdup_printf(
 			"<TEXT xml:space=\"preserve\" enc=\"utf-8\">%s</TEXT>",
-			msn_page_get_body(page));
+			body);
+	g_free(body);
 
 	if (ret_size != NULL)
 		*ret_size = strlen(str);


More information about the Commits mailing list