changeset 17162:1f0657cd89d3

Conversation -> Save As will now use aliases. Fixes #805
author Richard Laager <rlaager@wiktel.com>
date Sun, 20 May 2007 16:54:17 +0000
parents 51f8dac490d7
children ddf759c28d0b
files ChangeLog pidgin/gtkconv.c
diffstat 2 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun May 20 15:56:53 2007 +0000
+++ b/ChangeLog	Sun May 20 16:54:17 2007 +0000
@@ -41,6 +41,7 @@
 	  and the XScreenSaver change will reduce Pidgin's effect on power
 	  consumption when running with NO_HZ.  (Arjan van de Ven with Intel
 	  Corporation)
+	* Conversation -> Save As will now use aliases.
 
 	Finch:
 	* Userlist in chat windows, which can be turned on or off using
--- a/pidgin/gtkconv.c	Sun May 20 15:56:53 2007 +0000
+++ b/pidgin/gtkconv.c	Sun May 20 16:54:17 2007 +0000
@@ -1012,12 +1012,24 @@
 {
 	PidginWindow *win = data;
 	PurpleConversation *conv = pidgin_conv_window_get_active_conversation(win);
+	PurpleBuddy *buddy = purple_find_buddy(conv->account, conv->name);
+	const char *name;
 	gchar *buf;
-
-	buf = g_strdup_printf("%s.html", purple_normalize(conv->account, conv->name));
-
+	gchar *c;
+
+	if (buddy != NULL)
+		name = purple_buddy_get_contact_alias(buddy);
+	else
+		name = purple_normalize(conv->account, conv->name);
+
+	buf = g_strdup_printf("%s.html", name);
+	for (c = buf ; *c ; c++)
+	{
+		if (*c == '/' || *c == '\\')
+			*c = ' ';
+	}
 	purple_request_file(PIDGIN_CONVERSATION(conv), _("Save Conversation"),
-					  purple_escape_filename(buf),
+					  buf,
 					  TRUE, G_CALLBACK(savelog_writefile_cb), NULL,
 					  NULL, NULL, conv,
 					  conv);