changeset 23802:a6001ea0acbc

merge of '27269c5b28fd1f58228c46b310d26a5d208dac77' and '8bae3778af422c41094db4e639f2cf45e6ee6259'
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 15 Aug 2008 02:44:36 +0000
parents 28ba6f2bbf23 (current diff) 679a61dcf5c2 (diff)
children c7837c3ef7da
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 8 files changed, 44 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Fri Aug 15 00:36:40 2008 +0000
+++ b/ChangeLog.API	Fri Aug 15 02:44:36 2008 +0000
@@ -21,6 +21,7 @@
 		* 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 00:36:40 2008 +0000
+++ b/libpurple/protocols/msn/contact.c	Fri Aug 15 02:44:36 2008 +0000
@@ -221,7 +221,7 @@
 	
 	purple_debug_info("msn", "Creating an Address Book.\n");
 
-	body = g_markup_printf_escaped(MSN_ADD_ADDRESSBOOK_TEMPLATE,
+	body = purple_markup_printf_escaped(MSN_ADD_ADDRESSBOOK_TEMPLATE,
 		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS),
 		session->user->passport);
 
@@ -408,7 +408,7 @@
 		update_str = g_strdup_printf(MSN_GET_CONTACT_UPDATE_XML,update_time);
 	}
 
-	body = g_markup_printf_escaped(MSN_GET_CONTACT_TEMPLATE, partner_scenario_str,
+	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 : "");
 
@@ -807,7 +807,7 @@
 	else if (LastChanged != NULL)
 		update_str = g_strdup_printf(MSN_GET_ADDRESS_UPDATE_XML, LastChanged);
 
-	body = g_markup_printf_escaped(MSN_GET_ADDRESS_TEMPLATE,
+	body = purple_markup_printf_escaped(MSN_GET_ADDRESS_TEMPLATE,
 		MsnSoapPartnerScenarioText[partner_scenario],
 		msn_nexus_get_token_str(session->nexus, MSN_AUTH_CONTACTS),
 		update_str ? update_str : "");
--- a/libpurple/protocols/msn/msn.c	Fri Aug 15 00:36:40 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Fri Aug 15 02:44:36 2008 +0000
@@ -714,7 +714,7 @@
 			char *tmp2;
 
 			if (purple_presence_is_idle(presence)) {
-				tmp2 = g_markup_printf_escaped("%s/%s", name, _("Idle"));
+				tmp2 = purple_markup_printf_escaped("%s/%s", name, _("Idle"));
 			} else {
 				tmp2 = g_markup_escape_text(name, -1);
 			}
--- a/libpurple/protocols/msn/page.c	Fri Aug 15 00:36:40 2008 +0000
+++ b/libpurple/protocols/msn/page.c	Fri Aug 15 02:44:36 2008 +0000
@@ -53,7 +53,7 @@
 
 	g_return_val_if_fail(page != NULL, NULL);
 
-	str = g_markup_printf_escaped(
+	str = purple_markup_printf_escaped(
 			"<TEXT xml:space=\"preserve\" enc=\"utf-8\">%s</TEXT>",
 			msn_page_get_body(page));
 
--- a/libpurple/protocols/msn/slplink.c	Fri Aug 15 00:36:40 2008 +0000
+++ b/libpurple/protocols/msn/slplink.c	Fri Aug 15 02:44:36 2008 +0000
@@ -27,8 +27,6 @@
 #include "switchboard.h"
 #include "slp.h"
 
-#define MSN_DEBUG_SLPLINK
-
 void msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg);
 
 #ifdef MSN_DEBUG_SLP_FILES
--- a/libpurple/protocols/msn/switchboard.c	Fri Aug 15 00:36:40 2008 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Fri Aug 15 02:44:36 2008 +0000
@@ -34,8 +34,6 @@
 static void msg_error_helper(MsnCmdProc *cmdproc, MsnMessage *msg,
 							 MsnMsgErrorType error);
 
-#define MSN_DEBUG_SB
-
 /**************************************************************************
  * Main
  **************************************************************************/
--- a/libpurple/util.c	Fri Aug 15 00:36:40 2008 +0000
+++ b/libpurple/util.c	Fri Aug 15 02:44:36 2008 +0000
@@ -2499,6 +2499,29 @@
 	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 00:36:40 2008 +0000
+++ b/libpurple/util.h	Fri Aug 15 02:44:36 2008 +0000
@@ -576,6 +576,21 @@
 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, ...);
+
 /*@}*/