aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-06-08 21:19:08 +0800
committerMilan Crha <mcrha@redhat.com>2012-06-08 21:20:07 +0800
commita601031be2fa34f3f860179c8448cc0b04d4bfa4 (patch)
tree365e6889c0107c7ad279c4010d8a51d62eaa123f
parenta6cac3f275db19342e57f2d96141ccfbbf13a8ec (diff)
downloadgsoc2013-evolution-a601031be2fa34f3f860179c8448cc0b04d4bfa4.tar.gz
gsoc2013-evolution-a601031be2fa34f3f860179c8448cc0b04d4bfa4.tar.zst
gsoc2013-evolution-a601031be2fa34f3f860179c8448cc0b04d4bfa4.zip
Bug #300677 - vFolder rules shouldn't refer to the Unmatched folder
-rw-r--r--mail/e-mail-reader-utils.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index f56b094e14..f18d881ba2 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -1329,6 +1329,7 @@ mail_reader_create_vfolder_cb (CamelFolder *folder,
EMailSession *session;
EAlertSink *alert_sink;
CamelMimeMessage *message;
+ CamelFolder *use_folder;
GError *error = NULL;
alert_sink = e_activity_get_alert_sink (context->activity);
@@ -1362,10 +1363,26 @@ mail_reader_create_vfolder_cb (CamelFolder *folder,
backend = e_mail_reader_get_backend (context->reader);
session = e_mail_backend_get_session (backend);
+ use_folder = context->folder;
+ if (CAMEL_IS_VEE_FOLDER (use_folder)) {
+ CamelStore *parent_store;
+ CamelVeeFolder *vfolder;
+
+ parent_store = camel_folder_get_parent_store (use_folder);
+ vfolder = CAMEL_VEE_FOLDER (use_folder);
+
+ if (CAMEL_IS_VEE_STORE (parent_store) &&
+ vfolder == camel_vee_store_get_unmatched_folder (CAMEL_VEE_STORE (parent_store))) {
+ /* use source folder instead of the Unmatched folder */
+ use_folder = camel_vee_folder_get_vee_uid_folder (
+ vfolder, context->message_uid);
+ }
+ }
+
vfolder_gui_add_from_message (
session, message,
context->filter_type,
- context->folder);
+ use_folder);
g_object_unref (message);
@@ -1399,6 +1416,7 @@ e_mail_reader_create_vfolder_from_selected (EMailReader *reader,
context->activity = activity;
context->folder = g_object_ref (folder);
context->reader = g_object_ref (reader);
+ context->message_uid = g_strdup (message_uid);
context->filter_type = vfolder_type;
camel_folder_get_message (