pidgin.vv: b1f78f7a: Use aliases for the media window title a...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Fri Jan 30 04:55:22 EST 2009


-----------------------------------------------------------------
Revision: b1f78f7a0182066a48414e2907c9d606a4363225
Ancestor: d946032af3f0e797ceb1c1131cd58cdf93979277
Author: maiku at soc.pidgin.im
Date: 2009-01-30T09:50:01
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/b1f78f7a0182066a48414e2907c9d606a4363225

Modified files:
        pidgin/gtkmedia.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- pidgin/gtkmedia.c	0850a852589a2ff80d3f588d75536dc8b13a6073
+++ pidgin/gtkmedia.c	4a4ae6ec6e1617f6274918dbfdccd694639e86ef
@@ -641,8 +641,6 @@ pidgin_media_set_property (GObject *obje
 			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 @@ pidgin_media_new_cb(PurpleMediaManager *
 	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,


More information about the Commits mailing list