changeset 26069:e6d548856fcd

Use aliases for the media window title and the request window. Thanks to Marcus Lundblad for reminding me of this and practically giving me the code to copy/paste.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Fri, 30 Jan 2009 09:50:01 +0000
parents f95aa2b14bec
children 7be8c88d630c
files pidgin/gtkmedia.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkmedia.c	Fri Jan 30 08:58:07 2009 +0000
+++ b/pidgin/gtkmedia.c	Fri Jan 30 09:50:01 2009 +0000
@@ -641,8 +641,6 @@
 			if (media->priv->screenname)
 				g_free(media->priv->screenname);
 			media->priv->screenname = g_value_dup_string(value);
-			gtk_window_set_title(GTK_WINDOW(media),
-					media->priv->screenname);
 			break;
 		case PROP_SEND_LEVEL:
 			if (media->priv->send_level)
@@ -733,12 +731,17 @@
 	PidginMedia *gtkmedia = PIDGIN_MEDIA(
 			pidgin_media_new(media, screenname));
 	gboolean initiator;
+	PurpleBuddy *buddy = purple_find_buddy(
+			purple_connection_get_account(pc), screenname);
+	const gchar *alias = buddy ? 
+			purple_buddy_get_contact_alias(buddy) : screenname; 
 	gtkmedia->priv->pc = pc;
+	gtk_window_set_title(GTK_WINDOW(gtkmedia), alias);
 
 	g_object_get(G_OBJECT(media), "initiator", &initiator, NULL);
 	if (initiator == FALSE) {
 		gchar *message = g_strdup_printf("%s wishes to start a "
-				"media session with you\n", screenname);
+				"media session with you\n", alias);
 		purple_request_accept_cancel(media, "Media invitation",
 				message, NULL, 1, (void*)pc, screenname,
 				NULL, media, purple_media_accept,