changeset 23804:74e527fbb5e4

merge of '3b7b0deadf583b8df122dced7a6925e693af3223' and 'd38b0e23fda81858ef7fe68e99d088fa1e83f02b'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 15 Aug 2008 04:30:28 +0000
parents 35f7b7c62995 (diff) c7837c3ef7da (current diff)
children 29180633f672
files pidgin/pixmaps/emotes/default/24/disapointed.png pidgin/pixmaps/emotes/default/24/scalable/disapointed.svg pidgin/pixmaps/emotes/default/24/scalable/sigarette.svg
diffstat 6 files changed, 33 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Fri Aug 15 03:10:06 2008 +0000
+++ b/ChangeLog.API	Fri Aug 15 04:30:28 2008 +0000
@@ -21,7 +21,6 @@
 		* purple_cmds_get_handle, purple_cmds_init, purple_cmds_uninit
 		* cmd-added and cmd-removed signals
 		* purple_get_host_name
-		* purple_markup_printf_escaped
 		* purple_util_fetch_url_len (temporary function overload to add max_len param)
 		* purple_util_fetch_url_request_len
 
--- a/libpurple/protocols/msn/contact.c	Fri Aug 15 03:10:06 2008 +0000
+++ b/libpurple/protocols/msn/contact.c	Fri Aug 15 04:30:28 2008 +0000
@@ -214,6 +214,7 @@
 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 @@
 	
 	purple_debug_info("msn", "Creating an Address Book.\n");
 
-	body = purple_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 @@
 {
 	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 @@
 
 	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 = purple_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 @@
 	const char *dynamicItemLastChange)
 {
 	char *body, *update_str = NULL;
+	gchar *token_str;
 
 	purple_debug_misc("msn", "Getting Address Book\n");
 
@@ -807,10 +814,13 @@
 	else if (LastChanged != NULL)
 		update_str = g_strdup_printf(MSN_GET_ADDRESS_UPDATE_XML, LastChanged);
 
-	body = purple_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,
--- a/libpurple/protocols/msn/msn.c	Fri Aug 15 03:10:06 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Fri Aug 15 04:30:28 2008 +0000
@@ -713,10 +713,16 @@
 		if (name != NULL && *name) {
 			char *tmp2;
 
+			tmp2 = g_markup_escape_text(name, -1);
 			if (purple_presence_is_idle(presence)) {
-				tmp2 = purple_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) {
--- a/libpurple/protocols/msn/page.c	Fri Aug 15 03:10:06 2008 +0000
+++ b/libpurple/protocols/msn/page.c	Fri Aug 15 04:30:28 2008 +0000
@@ -50,12 +50,15 @@
 msn_page_gen_payload(const MsnPage *page, size_t *ret_size)
 {
 	char *str;
+	char *body;
 
 	g_return_val_if_fail(page != NULL, NULL);
 
-	str = purple_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);
--- a/libpurple/util.c	Fri Aug 15 03:10:06 2008 +0000
+++ b/libpurple/util.c	Fri Aug 15 04:30:28 2008 +0000
@@ -2499,29 +2499,6 @@
 	return g_strndup(tag+1, i-1);
 }
 
-char *
-purple_markup_printf_escaped(const char *format, ...)
-{
-	va_list args;
-	char *ret;
-
-#if GLIB_CHECK_VERSION(2,4,0)
-	va_start(args, format);
-	ret = g_markup_vprintf_escaped(format, args);
-	va_end(args);
-#else
-	char *tmp;
-
-	va_start(args, format);
-	tmp = g_strdup_vprintf(format, args);
-	va_end(args);
-	ret = g_markup_escape_text(tmp, -1);
-	g_free(tmp);
-
-#endif
-
-	return ret;
-}
 /**************************************************************************
  * Path/Filename Functions
  **************************************************************************/
--- a/libpurple/util.h	Fri Aug 15 03:10:06 2008 +0000
+++ b/libpurple/util.h	Fri Aug 15 04:30:28 2008 +0000
@@ -576,21 +576,6 @@
 char * purple_markup_get_css_property(const gchar *style, const gchar *opt);
 
 
-/**
- *
- * Formats arguments according to @a format, escaping all string and character
- * arguments in the fashion of g_markup_escape_text(). This is useful when you
- * want to insert literal strings into XML-style markup output, without having
- * to worry that the strings might themselves contain markup.
- *
- * This exists for Glib backwards compatibility reasons.
- *
- * @param format The format
- *
- * @return The string
- */
-char * purple_markup_printf_escaped(const char *format, ...);
-
 /*@}*/