changeset 24726:694591875bc9

Use the friendly/vanity url when it's available in myspace "View web profile" links
author Mark Doliner <mark@kingant.net>
date Mon, 15 Dec 2008 19:02:35 +0000
parents a5f2536b911b
children 3f4bf7c43df4 16b901793d7c
files libpurple/protocols/myspace/user.c libpurple/protocols/myspace/user.h
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/user.c	Mon Dec 15 09:48:20 2008 +0000
+++ b/libpurple/protocols/myspace/user.c	Mon Dec 15 19:02:35 2008 +0000
@@ -174,8 +174,12 @@
 		/* TODO: link to username, if available */
 		char *profile;
 		purple_notify_user_info_add_section_break(user_info);
-		profile = g_strdup_printf("<a href=\"http://myspace.com/%d\">%s</a>",
-				user->id, _("View web profile"));
+		if (user->buddy != NULL)
+			profile = g_strdup_printf("<a href=\"http://myspace.com/%s\">%s</a>",
+					purple_buddy_get_name(user->buddy), _("View web profile"));
+		else
+			profile = g_strdup_printf("<a href=\"http://myspace.com/%d\">%s</a>",
+					user->id, _("View web profile"));
 		purple_notify_user_info_add_pair(user_info, NULL, profile);
 		g_free(profile);
 	}
--- a/libpurple/protocols/myspace/user.h	Mon Dec 15 09:48:20 2008 +0000
+++ b/libpurple/protocols/myspace/user.h	Mon Dec 15 19:02:35 2008 +0000
@@ -25,6 +25,7 @@
 typedef struct _MsimUser
 {
 	PurpleBuddy *buddy;
+	/* Note: id is also &buddy->node (set_blist_node_int), when buddy is non-NULL */
 	int id;
 	guint client_cv;
 	gchar *client_info;
@@ -34,7 +35,6 @@
 	guint total_friends;
 	gchar *headline;
 	gchar *display_name;
-	/* Note: uid is in &buddy->node (set_blist_node_int), since it never changes */
 	gchar *username;
 	gchar *band_name, *song_name;
 	gchar *image_url;