changeset 31362:41f1e44ad4b5

propagate from branch 'im.pidgin.pidgin' (head 6f879669a6513a5c40335bbaefe842389a92b39e) to branch 'im.pidgin.pidgin.next.minor' (head 8cdcfae03192b964373cd95a73342d30ed15d13a)
author Marcus Lundblad <ml@update.uu.se>
date Sat, 20 Nov 2010 13:02:08 +0000
parents 250a16f2548f (current diff) 0123c69ec0e5 (diff)
children 539aa44be788
files ChangeLog.API configure.ac libpurple/protocols/jabber/buddy.c libpurple/protocols/jabber/google.c libpurple/protocols/jabber/google.h libpurple/protocols/msn/dialog.c libpurple/protocols/msn/dialog.h libpurple/protocols/msn/msn.c libpurple/protocols/msn/sync.c libpurple/protocols/msn/sync.h libpurple/protocols/oscar/family_advert.c libpurple/protocols/oscar/family_invite.c libpurple/protocols/oscar/family_odir.c libpurple/protocols/oscar/family_translate.c libpurple/protocols/yahoo/libymsg.c pidgin/pixmaps/emotes/small/16/cool.png pidgin/pixmaps/emotes/small/16/grin.png pidgin/win32/IdleTracker/Makefile.mingw pidgin/win32/IdleTracker/idletrack.c pidgin/win32/IdleTracker/idletrack.h
diffstat 8 files changed, 66 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Sat Nov 20 09:21:29 2010 +0000
+++ b/ChangeLog.API	Sat Nov 20 13:02:08 2010 +0000
@@ -1,5 +1,10 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
+version 2.8.0 (??/??/????):
+	libpurple:
+		Added:
+		* purple_notify_user_info_add_pair_plaintext
+
 version 2.7.6 (??/??/????):
 
 version 2.7.5 (10/31/2010):
--- a/configure.ac	Sat Nov 20 09:21:29 2010 +0000
+++ b/configure.ac	Sat Nov 20 13:02:08 2010 +0000
@@ -43,10 +43,10 @@
 #
 # Make sure to update finch/libgnt/configure.ac with libgnt version changes.
 #
-m4_define([purple_lt_current], [7])
+m4_define([purple_lt_current], [8])
 m4_define([purple_major_version], [2])
-m4_define([purple_minor_version], [7])
-m4_define([purple_micro_version], [6])
+m4_define([purple_minor_version], [8])
+m4_define([purple_micro_version], [0])
 m4_define([purple_version_suffix], [devel])
 m4_define([purple_version],
           [purple_major_version.purple_minor_version.purple_micro_version])
--- a/libpurple/notify.c	Sat Nov 20 09:21:29 2010 +0000
+++ b/libpurple/notify.c	Sat Nov 20 13:02:08 2010 +0000
@@ -602,6 +602,18 @@
 }
 
 void
+purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
+{
+	gchar *escaped;
+	PurpleNotifyUserInfoEntry *entry;
+
+	escaped = g_markup_escape_text(value, -1);
+	entry = purple_notify_user_info_entry_new(label, escaped);
+	g_free(escaped);
+	user_info->user_info_entries = g_list_append(user_info->user_info_entries, entry);
+}
+
+void
 purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value)
 {
 	PurpleNotifyUserInfoEntry *entry;
--- a/libpurple/notify.h	Sat Nov 20 09:21:29 2010 +0000
+++ b/libpurple/notify.h	Sat Nov 20 13:02:08 2010 +0000
@@ -540,13 +540,28 @@
  *                   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
+ *                   the label.  This should be valid HTML.  If you want
+ *                   to insert plaintext then use
+ *                   purple_notify_user_info_add_pair_plaintext(), instead.
+ *                   If this is NULL the label will still be displayed;
+ *                   the UI should treat label as independent and not
  *                   include a colon if it would otherwise.
  */
+/*
+ * TODO: In 3.0.0 this function should be renamed to
+ *       purple_notify_user_info_add_pair_html().  And optionally
+ *       purple_notify_user_info_add_pair_plaintext() could be renamed to
+ *       purple_notify_user_info_add_pair().
+ */
 void purple_notify_user_info_add_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value);
 
 /**
+ * Like purple_notify_user_info_add_pair, but value should be plaintext
+ * and will be escaped using g_markup_escape_text().
+ */
+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
--- a/libpurple/protocols/jabber/buddy.c	Sat Nov 20 09:21:29 2010 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Sat Nov 20 13:02:08 2010 +0000
@@ -1021,7 +1021,7 @@
 				if (!serverside_alias)
 					serverside_alias = g_strdup(text);
 
-				purple_notify_user_info_add_pair(user_info, _("Full Name"), text);
+				purple_notify_user_info_add_pair_plaintext(user_info, _("Full Name"), text);
 			} else if(!strcmp(child->name, "N")) {
 				for(child2 = child->child; child2; child2 = child2->next)
 				{
@@ -1032,11 +1032,11 @@
 
 					text2 = xmlnode_get_data(child2);
 					if(text2 && !strcmp(child2->name, "FAMILY")) {
-						purple_notify_user_info_add_pair(user_info, _("Family Name"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Family Name"), text2);
 					} else if(text2 && !strcmp(child2->name, "GIVEN")) {
-						purple_notify_user_info_add_pair(user_info, _("Given Name"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Given Name"), text2);
 					} else if(text2 && !strcmp(child2->name, "MIDDLE")) {
-						purple_notify_user_info_add_pair(user_info, _("Middle Name"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Middle Name"), text2);
 					}
 					g_free(text2);
 				}
@@ -1047,10 +1047,10 @@
 					g_free(serverside_alias);
 					serverside_alias = g_strdup(text);
 
-					purple_notify_user_info_add_pair(user_info, _("Nickname"), text);
+					purple_notify_user_info_add_pair_plaintext(user_info, _("Nickname"), text);
 				}
 			} else if(text && !strcmp(child->name, "BDAY")) {
-				purple_notify_user_info_add_pair(user_info, _("Birthday"), text);
+				purple_notify_user_info_add_pair_plaintext(user_info, _("Birthday"), text);
 			} else if(!strcmp(child->name, "ADR")) {
 				gboolean address_line_added = FALSE;
 
@@ -1074,25 +1074,25 @@
 					}
 
 					if(!strcmp(child2->name, "POBOX")) {
-						purple_notify_user_info_add_pair(user_info, _("P.O. Box"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("P.O. Box"), text2);
 					} else if (g_str_equal(child2->name, "EXTADD") || g_str_equal(child2->name, "EXTADR")) {
 						/*
 						 * EXTADD is correct, EXTADR is generated by other
 						 * clients. The next time someone reads this, remove
 						 * EXTADR.
 						 */
-						purple_notify_user_info_add_pair(user_info, _("Extended Address"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Extended Address"), text2);
 					} else if(!strcmp(child2->name, "STREET")) {
-						purple_notify_user_info_add_pair(user_info, _("Street Address"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Street Address"), text2);
 					} else if(!strcmp(child2->name, "LOCALITY")) {
-						purple_notify_user_info_add_pair(user_info, _("Locality"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Locality"), text2);
 					} else if(!strcmp(child2->name, "REGION")) {
-						purple_notify_user_info_add_pair(user_info, _("Region"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Region"), text2);
 					} else if(!strcmp(child2->name, "PCODE")) {
-						purple_notify_user_info_add_pair(user_info, _("Postal Code"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Postal Code"), text2);
 					} else if(!strcmp(child2->name, "CTRY")
 								|| !strcmp(child2->name, "COUNTRY")) {
-						purple_notify_user_info_add_pair(user_info, _("Country"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Country"), text2);
 					}
 					g_free(text2);
 				}
@@ -1106,13 +1106,13 @@
 					/* show what kind of number it is */
 					number = xmlnode_get_data(child2);
 					if(number) {
-						purple_notify_user_info_add_pair(user_info, _("Telephone"), number);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Telephone"), number);
 						g_free(number);
 					}
 				} else if((number = xmlnode_get_data(child))) {
 					/* lots of clients (including purple) do this, but it's
 					 * out of spec */
-					purple_notify_user_info_add_pair(user_info, _("Telephone"), number);
+					purple_notify_user_info_add_pair_plaintext(user_info, _("Telephone"), number);
 					g_free(number);
 				}
 			} else if(!strcmp(child->name, "EMAIL")) {
@@ -1153,18 +1153,18 @@
 
 					text2 = xmlnode_get_data(child2);
 					if(text2 && !strcmp(child2->name, "ORGNAME")) {
-						purple_notify_user_info_add_pair(user_info, _("Organization Name"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Organization Name"), text2);
 					} else if(text2 && !strcmp(child2->name, "ORGUNIT")) {
-						purple_notify_user_info_add_pair(user_info, _("Organization Unit"), text2);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Organization Unit"), text2);
 					}
 					g_free(text2);
 				}
 			} else if(text && !strcmp(child->name, "TITLE")) {
-				purple_notify_user_info_add_pair(user_info, _("Job Title"), text);
+				purple_notify_user_info_add_pair_plaintext(user_info, _("Job Title"), text);
 			} else if(text && !strcmp(child->name, "ROLE")) {
-				purple_notify_user_info_add_pair(user_info, _("Role"), text);
+				purple_notify_user_info_add_pair_plaintext(user_info, _("Role"), text);
 			} else if(text && !strcmp(child->name, "DESC")) {
-				purple_notify_user_info_add_pair(user_info, _("Description"), text);
+				purple_notify_user_info_add_pair_plaintext(user_info, _("Description"), text);
 			} else if(!strcmp(child->name, "PHOTO") ||
 					!strcmp(child->name, "LOGO")) {
 				char *bintext = NULL;
--- a/libpurple/protocols/msn/msn.c	Sat Nov 20 09:21:29 2010 +0000
+++ b/libpurple/protocols/msn/msn.c	Sat Nov 20 13:02:08 2010 +0000
@@ -970,7 +970,6 @@
 		const char *psm, *name;
 		const char *mediatype = NULL;
 		char *currentmedia = NULL;
-		char *tmp;
 
 		psm = purple_status_get_attr_string(status, "message");
 		if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
@@ -1014,9 +1013,7 @@
 			}
 
 			if (psm != NULL && *psm) {
-				tmp = g_markup_escape_text(psm, -1);
-				purple_notify_user_info_add_pair(user_info, tmp2, tmp);
-				g_free(tmp);
+				purple_notify_user_info_add_pair_plaintext(user_info, tmp2, psm);
 			} else {
 				purple_notify_user_info_add_pair(user_info, _("Status"), tmp2);
 			}
@@ -1024,13 +1021,11 @@
 			g_free(tmp2);
 		} else {
 			if (psm != NULL && *psm) {
-				tmp = g_markup_escape_text(psm, -1);
 				if (purple_presence_is_idle(presence)) {
-					purple_notify_user_info_add_pair(user_info, _("Idle"), tmp);
+					purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), psm);
 				} else {
-					purple_notify_user_info_add_pair(user_info, _("Status"), tmp);
+					purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), psm);
 				}
-				g_free(tmp);
 			} else {
 				if (purple_presence_is_idle(presence)) {
 					purple_notify_user_info_add_pair(user_info, _("Status"),
@@ -2221,9 +2216,7 @@
 		alias = purple_buddy_get_local_buddy_alias(b);
 		if (alias && alias[0])
 		{
-			char *aliastext = g_markup_escape_text(alias, -1);
-			purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext);
-			g_free(aliastext);
+			purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), alias);
 		}
 
 		if ((alias = purple_buddy_get_server_alias(b)) != NULL)
--- a/libpurple/protocols/yahoo/libymsg.c	Sat Nov 20 09:21:29 2010 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Sat Nov 20 13:02:08 2010 +0000
@@ -3975,7 +3975,6 @@
 void yahoo_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full)
 {
 	YahooFriend *f;
-	char *escaped;
 	char *status = NULL;
 	const char *presence = NULL;
 	PurpleAccount *account;
@@ -4014,14 +4013,12 @@
 	}
 
 	if (status != NULL) {
-		escaped = g_markup_escape_text(status, strlen(status));
-		purple_notify_user_info_add_pair(user_info, _("Status"), escaped);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), status);
 		g_free(status);
-		g_free(escaped);
 	}
 
 	if (presence != NULL)
-		purple_notify_user_info_add_pair(user_info, _("Presence"), presence);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Presence"), presence);
 
 	if (f && full) {
 		YahooPersonalDetails *ypd = &f->ypd;
--- a/libpurple/protocols/yahoo/yahoo_profile.c	Sat Nov 20 09:21:29 2010 +0000
+++ b/libpurple/protocols/yahoo/yahoo_profile.c	Sat Nov 20 13:02:08 2010 +0000
@@ -701,14 +701,12 @@
 	if (b) {
 		const char *balias = purple_buddy_get_local_buddy_alias(b);
 		if(balias && balias[0]) {
-			char *aliastext = g_markup_escape_text(balias, -1);
-			purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext);
-			g_free(aliastext);
+			purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), balias);
 		}
 		#if 0
 		if (b->idle > 0) {
 			char *idletime = purple_str_seconds_to_string(time(NULL) - b->idle);
-			purple_notify_user_info_add_pair(user_info, _("Idle"), idletime);
+			purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), idletime);
 			g_free(idletime);
 		}
 		#endif
@@ -719,7 +717,7 @@
 		if ((f = yahoo_friend_find(info_data->gc, purple_buddy_get_name(b)))) {
 			const char *ip;
 			if ((ip = yahoo_friend_get_ip(f)))
-				purple_notify_user_info_add_pair(user_info, _("IP Address"), ip);
+				purple_notify_user_info_add_pair_plaintext(user_info, _("IP Address"), ip);
 		}
 	}
 }