aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog1
-rw-r--r--mail/mail-ops.c27
2 files changed, 20 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 0231256e99..41188d71e5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -2,6 +2,7 @@
* mail-ops.c (add_vtrash_info): Use g_strcasecmp() when looking
for a Trash folder - it may be lowercase or something funky.
+ (transfer_messages_transfer): Special-case vtrash folders.
* mail-local.c (init_trash): No need to specify the vfolder
expression here. This code was moved into camel-vtrash-folder.c
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 3c8818020d..e6c516a46e 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -35,6 +35,7 @@
#include <gal/widgets/e-unicode.h>
#include <camel/camel-mime-filter-from.h>
#include <camel/camel-operation.h>
+#include <camel/camel-vtrash-folder.h>
#include "mail.h"
#include "mail-tools.h"
#include "mail-ops.h"
@@ -893,7 +894,7 @@ transfer_messages_transfer (struct _mail_msg *mm)
void (*func) (CamelFolder *, GPtrArray *,
CamelFolder *,
CamelException *);
-
+
if (m->delete) {
func = camel_folder_move_messages_to;
desc = _("Moving");
@@ -901,20 +902,30 @@ transfer_messages_transfer (struct _mail_msg *mm)
func = camel_folder_copy_messages_to;
desc = _("Copying");
}
-
+
dest = mail_tool_uri_to_folder (m->dest_uri, &mm->ex);
if (camel_exception_is_set (&mm->ex))
return;
-
+
camel_folder_freeze (m->source);
camel_folder_freeze (dest);
- (func) (m->source, m->uids, dest, &mm->ex);
+ if (CAMEL_IS_VTRASH_FOLDER (dest)) {
+ if (m->delete) {
+ int i;
+
+ for (i = 0; i < m->uids->len; i++)
+ camel_folder_delete_message (m->source, m->uids->pdata[i]);
+ } else {
+ /* no-op - can't copy messages to*/
+ }
+ } else
+ (func) (m->source, m->uids, dest, &mm->ex);
- camel_folder_thaw(m->source);
- camel_folder_thaw(dest);
- camel_folder_sync(dest, FALSE, NULL);
- camel_object_unref((CamelObject *)dest);
+ camel_folder_thaw (m->source);
+ camel_folder_thaw (dest);
+ camel_folder_sync (dest, FALSE, NULL);
+ camel_object_unref (CAMEL_OBJECT (dest));
}
static void