[evolution-patches] fix for bug #269129



http://bugzilla.gnome.org/show_bug.cgi?id=269129

should be considered for both branches

-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3619
diff -u -r1.3619 ChangeLog
--- ChangeLog	13 Apr 2005 03:32:58 -0000	1.3619
+++ ChangeLog	21 Apr 2005 20:26:26 -0000
@@ -1,3 +1,9 @@
+2005-04-21  Jeffrey Stedfast  <fejj novell com>
+
+	* em-composer-utils.c (post_reply_to_message): Use the real folder
+	and real uid (not the virtual if replying to a message in a
+	vfolder). Fixes bug #269129.
+
 2005-04-12  Not Zed  <NotZed Ximian com>
 
 	** See bug #273752
Index: em-composer-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-composer-utils.c,v
retrieving revision 1.36
diff -u -r1.36 em-composer-utils.c
--- em-composer-utils.c	8 Apr 2005 17:48:45 -0000	1.36
+++ em-composer-utils.c	21 Apr 2005 20:26:26 -0000
@@ -52,6 +52,7 @@
 #include <camel/camel-string-utils.h>
 #include <camel/camel-stream-mem.h>
 #include <camel/camel-nntp-address.h>
+#include <camel/camel-vee-folder.h>
 
 static EAccount * guess_account (CamelMimeMessage *message, CamelFolder *folder);
 
@@ -1958,15 +1959,29 @@
 	const char *message_id, *references;
 	CamelInternetAddress *to;
 	EDestination **tov = NULL;
+	CamelFolder *real_folder;
 	EMsgComposer *composer;
 	char *subject, *url;
 	EAccount *account;
+	char *real_uid;
 	guint32 flags;
 	
 	if (message == NULL)
 		return;
 	
-	account = guess_account (message, folder);
+	if (CAMEL_IS_VEE_FOLDER (folder)) {
+		CamelMessageInfo *info;
+		
+		info = camel_folder_get_message_info (folder, uid);
+		real_folder = camel_vee_folder_get_location ((CamelVeeFolder *) folder, (struct _CamelVeeMessageInfo *) info, &real_uid);
+		camel_folder_free_message_info (folder, info);
+	} else {
+		real_folder = folder;
+		camel_object_ref (folder);
+		real_uid = g_strdup (uid);
+	}
+	
+	account = guess_account (message, real_folder);
 	flags = CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN;
 	
 	to = camel_internet_address_new();
@@ -1991,7 +2006,7 @@
 	
 	g_free (subject);
 	
-	url = mail_tools_folder_to_url (folder);
+	url = mail_tools_folder_to_url (real_folder);
 	e_msg_composer_hdrs_set_post_to ((EMsgComposerHdrs *) composer->hdrs, url);
 	g_free (url);
 	
@@ -2020,12 +2035,14 @@
 	
 	composer_set_body (composer, message, NULL);
 	
-	em_composer_utils_setup_callbacks (composer, folder, uid, flags, flags, NULL, NULL);
+	em_composer_utils_setup_callbacks (composer, real_folder, real_uid, flags, flags, NULL, NULL);
 	
 	gtk_widget_show (GTK_WIDGET (composer));	
 	e_msg_composer_unset_changed (composer);
-
+	
+	camel_object_unref (real_folder);
 	camel_object_unref(to);
+	g_free (real_uid);
 }
 
 /**

Attachment: smime.p7s
Description: S/MIME cryptographic signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]