aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-filter-driver.c25
2 files changed, 29 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 00bfecf372..2b89937162 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,10 @@
+2002-03-28 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-filter-driver.c (do_copy): We now have to check to make
+ sure that p->message is non-NULL because we only load the message
+ when we have to.
+ (do_move): Same here.
+
2002-03-28 Dan Winship <danw@ximian.com>
* camel-transport.c (camel_transport_send_to): Change the message
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 9b62e119b5..f5dd16756c 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -461,11 +461,20 @@ do_copy (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
g_ptr_array_add (uids, (char *) p->uid);
camel_folder_copy_messages_to (p->source, uids, outbox, p->ex);
g_ptr_array_free (uids, TRUE);
- } else
+ } else {
+ if (p->message == NULL)
+ p->message = camel_folder_get_message (p->source, p->uid, p->ex);
+
+ if (!p->message) {
+ /* FIXME: exception? */
+ continue;
+ }
+
camel_folder_append_message (outbox, p->message, p->info, p->ex);
+ }
if (!camel_exception_is_set (p->ex))
- p->copied = TRUE;
+ p->copied = TRUE;
camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Copy to folder %s",
folder);
@@ -503,8 +512,17 @@ do_move (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriv
g_ptr_array_add (uids, (char *) p->uid);
camel_folder_copy_messages_to (p->source, uids, outbox, p->ex);
g_ptr_array_free (uids, TRUE);
- } else
+ } else {
+ if (p->message == NULL)
+ p->message = camel_folder_get_message (p->source, p->uid, p->ex);
+
+ if (!p->message) {
+ /* FIXME: exception? */
+ continue;
+ }
+
camel_folder_append_message (outbox, p->message, p->info, p->ex);
+ }
if (!camel_exception_is_set (p->ex)) {
/* a 'move' is a copy & delete */
@@ -744,6 +762,7 @@ camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, co
/* FIXME: does this need locking? Probably */
+ /* FIXME: use info for these, not message since message may not be loaded */
from = camel_mime_message_get_from (p->message);
fromstr = camel_address_format((CamelAddress *)from);
subject = camel_mime_message_get_subject (p->message);