pidgin: 25abd216: Actually commit the purple_notify_user_i...

markdoliner at pidgin.im markdoliner at pidgin.im
Mon Aug 22 02:35:37 EDT 2011


----------------------------------------------------------------------
Revision: 25abd21662b445023be41dbf93d6bbf9ccbbdea9
Parent:   6f5af0434e9e0e13d615df333538f6b7b1759b63
Author:   markdoliner at pidgin.im
Date:     08/22/11 02:32:44
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/25abd21662b445023be41dbf93d6bbf9ccbbdea9

Changelog: 

Actually commit the purple_notify_user_info_prepend_pair_plaintext
function.  I think I left it off my previous commit?  Sorry.
And rename purple_notify_user_info_prepend_pair to
purple_notify_user_info_prepend_pair_html_html

Changes against parent 6f5af0434e9e0e13d615df333538f6b7b1759b63

  patched  ChangeLog.API
  patched  libpurple/notify.c
  patched  libpurple/notify.h
  patched  libpurple/plugins/perl/common/Notify.xs
  patched  libpurple/protocols/jabber/buddy.c
  patched  libpurple/protocols/msn/msn.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	1925449a3b60c83199e784559beb3278f2c7221b
+++ libpurple/protocols/msn/msn.c	8ba865c149b31ccdbcc97a49bf8f6bf24dfc40ba
@@ -2812,7 +2812,7 @@ msn_got_photo(PurpleUtilFetchUrlData *ur
 			purple_debug_info("msn", "%s is %" G_GSIZE_FORMAT " bytes\n", photo_url_text, len);
 			id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL);
 			g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id);
-			purple_notify_user_info_prepend_pair(user_info, NULL, buf);
+			purple_notify_user_info_prepend_pair_html(user_info, NULL, buf);
 		}
 	}
 
============================================================
--- libpurple/notify.c	dd8da681d1dde9795fe9edd70cf262640762e003
+++ libpurple/notify.c	08e10f6f929bf17b0348613541b5689e4d14f3b2
@@ -594,7 +594,7 @@ void
 }
 
 void
-purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
+purple_notify_user_info_prepend_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
 {
 	PurpleNotifyUserInfoEntry *entry;
 
@@ -603,6 +603,16 @@ void
 }
 
 void
+purple_notify_user_info_prepend_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
+{
+	gchar *escaped;
+
+	escaped = g_markup_escape_text(value, -1);
+	purple_notify_user_info_prepend_pair_html(user_info, label, escaped);
+	g_free(escaped);
+}
+
+void
 purple_notify_user_info_remove_entry(PurpleNotifyUserInfo *user_info, PurpleNotifyUserInfoEntry *entry)
 {
 	g_return_if_fail(user_info != NULL);
============================================================
--- libpurple/notify.h	d6cd3118f273ef9b2e9bd6997df553eadc333bb3
+++ libpurple/notify.h	8594c96f730538e44c8e85ec27f74cd63f2861b6
@@ -489,20 +489,17 @@ void purple_notify_user_info_add_pair_pl
 void purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value);
 
 /**
- * Prepend a label/value pair to a PurpleNotifyUserInfo object
- *
- * @param user_info  The PurpleNotifyUserInfo
- * @param label      A label, which for example might be displayed by a
- *                   UI with a colon after it ("Status:"). Do not include
- *                   a colon.  If NULL, value will be displayed without a
- *                   label.
- * @param value      The value, which might be displayed by a UI after
- *                   the label.  If NULL, label will still be displayed;
- *                   the UI should then treat label as independent and not
- *                   include a colon if it would otherwise.
+ * Like purple_notify_user_info_add_pair_html, but the pair is inserted
+ * at the beginning of the list.
  */
-void purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value);
+void purple_notify_user_info_prepend_pair_html(PurpleNotifyUserInfo *user_info, const char *label, const char *value);
 
+/**
+ * Like purple_notify_user_info_prepend_pair_html, but value should be plaintext
+ * and will be escaped using g_markup_escape_text().
+ */
+void purple_notify_user_info_prepend_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value);
+
 #if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_NOTIFY_C_)
 /**
  * Remove a PurpleNotifyUserInfoEntry from a PurpleNotifyUserInfo object
@@ -525,9 +522,10 @@ void purple_notify_user_info_remove_entr
  * If added to a PurpleNotifyUserInfo object, this should not be free()'d,
  * as PurpleNotifyUserInfo will do so when destroyed.
  * purple_notify_user_info_add_pair_html(),
- * purple_notify_user_info_add_pair_plaintext() and
- * purple_notify_user_info_prepend_pair() are convenience methods for
- * creating entries and adding them to a PurpleNotifyUserInfo.
+ * purple_notify_user_info_add_pair_plaintext(),
+ * purple_notify_user_info_prepend_pair_html() and
+ * purple_notify_user_info_prepend_pair_plaintext() are convenience
+ * methods for creating entries and adding them to a PurpleNotifyUserInfo.
  *
  * @param label  A label, which for example might be displayed by a UI
  *               with a colon after it ("Status:"). Do not include a
============================================================
--- libpurple/protocols/jabber/buddy.c	aa561d6dcf6b78119e760654f497185fe3ed86f1
+++ libpurple/protocols/jabber/buddy.c	192ff18e3fa0f353cc38303aa5c97bd81041d5bc
@@ -733,13 +733,13 @@ add_jbr_info(JabberBuddyInfo *jbi, const
 		                    (jbr->client.version ? jbr->client.version : ""));
 		/* TODO: Check whether it's correct to call prepend_pair_html,
 		         or if we should be using prepend_pair_plaintext */
-		purple_notify_user_info_prepend_pair(user_info, _("Client"), tmp);
+		purple_notify_user_info_prepend_pair_html(user_info, _("Client"), tmp);
 		g_free(tmp);
 
 		if (jbr->client.os) {
 			/* TODO: Check whether it's correct to call prepend_pair_html,
 			         or if we should be using prepend_pair_plaintext */
-			purple_notify_user_info_prepend_pair(user_info, _("Operating System"), jbr->client.os);
+			purple_notify_user_info_prepend_pair_html(user_info, _("Operating System"), jbr->client.os);
 		}
 	}
 
@@ -784,7 +784,7 @@ add_jbr_info(JabberBuddyInfo *jbi, const
 		tmp = g_strdup_printf("%s%s%s", (status_name ? status_name : ""),
 						((status_name && purdy) ? ": " : ""),
 						(purdy ? purdy : ""));
-		purple_notify_user_info_prepend_pair(user_info, _("Status"), tmp);
+		purple_notify_user_info_prepend_pair_html(user_info, _("Status"), tmp);
 
 		g_snprintf(priority, sizeof(priority), "%d", jbr->priority);
 		purple_notify_user_info_prepend_pair_plaintext(user_info, _("Priority"), priority);
@@ -835,7 +835,7 @@ static void jabber_buddy_info_show_if_re
 			if (jbr->name) {
 				/* TODO: Check whether it's correct to call prepend_pair_html,
 				         or if we should be using prepend_pair_plaintext */
-				purple_notify_user_info_prepend_pair(user_info, _("Resource"), jbr->name);
+				purple_notify_user_info_prepend_pair_html(user_info, _("Resource"), jbr->name);
 			}
 		}
 	}
@@ -868,7 +868,7 @@ static void jabber_buddy_info_show_if_re
 				                jbi->last_message ? jbi->last_message : "");
 			/* TODO: Check whether it's correct to call prepend_pair_html,
 			         or if we should be using prepend_pair_plaintext */
-			purple_notify_user_info_prepend_pair(user_info, _("Status"), status);
+			purple_notify_user_info_prepend_pair_html(user_info, _("Status"), status);
 			g_free(status);
 		}
 	}
============================================================
--- ChangeLog.API	a5a7ba4c246eafd0addd30a3c37c516590859006
+++ ChangeLog.API	899a2adc7ebd64276ec965cde8007f54b737dc4e
@@ -5,6 +5,7 @@ version 3.0.0 (??/??/????):
 		Added:
 		* purple_notify_searchresult_column_set_visible
 		* purple_notify_searchresult_column_is_visible
+		* purple_notify_user_info_prepend_pair_plaintext
 		* purple_request_field_set_tooltip
 		* purple_request_field_get_tooltip
 
@@ -15,6 +16,8 @@ version 3.0.0 (??/??/????):
 		  purple_notify_user_info_add_pair_html
 		* purple_notify_user_info_get_entries returns a GQueue instead of
 		  a GList
+		* purple_notify_user_info_prepend_pair renamed to
+		  purple_notify_user_info_prepend_pair_html_html
 		* purple_util_fetch_url_request_len now takes a PurpleAccount as
 		  the first parameter
 		* PurpleConnectionUiOps.report_disconnect now passes a
============================================================
--- libpurple/plugins/perl/common/Notify.xs	5f51d009f95058b17746688436fc9aaaf4b5e787
+++ libpurple/plugins/perl/common/Notify.xs	b1183a6f035854344a3c4d84e0593046ee1c6ef1
@@ -150,7 +150,7 @@ void purple_notify_user_info_add_pair_ht
 	const char *label
 	const char *value
 
-void purple_notify_user_info_prepend_pair(user_info, label, value)
+void purple_notify_user_info_prepend_pair_html(user_info, label, value)
 	Purple::NotifyUserInfo user_info
 	const char *label
 	const char *value


More information about the Commits mailing list