changeset 17166:ddf759c28d0b

merge of '004942f80429de395663b172b5d6c6e7d834050a' and 'ff732da54be1455c1077c12232b125b47357a9a7'
author Richard Laager <rlaager@wiktel.com>
date Sun, 20 May 2007 18:32:40 +0000
parents 569fa7a11a99 (current diff) 1f0657cd89d3 (diff)
children c6c9f8a6dd9c 0598803f9b64 1e674c0886b1
files ChangeLog
diffstat 3 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun May 20 17:05:42 2007 +0000
+++ b/ChangeLog	Sun May 20 18:32:40 2007 +0000
@@ -42,6 +42,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/libpurple/util.c	Sun May 20 17:05:42 2007 +0000
+++ b/libpurple/util.c	Sun May 20 18:32:40 2007 +0000
@@ -4212,7 +4212,7 @@
 		gunichar c = g_utf8_get_char(iter);
 		/* If the character is an ASCII character and is alphanumeric,
 		 * or one of the specified values, no need to escape */
-		if (c < 128 && (isalnum(c) || c == '@' || c == '-' ||
+		if (c < 128 && (g_ascii_isalnum(c) || c == '@' || c == '-' ||
 				c == '_' || c == '.' || c == '#')) {
 			buf[j++] = c;
 		} else {
--- a/pidgin/gtkconv.c	Sun May 20 17:05:42 2007 +0000
+++ b/pidgin/gtkconv.c	Sun May 20 18:32:40 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);