[evolution-patches] 70590, filtering/move change




this patch makes 'move' perform an implicit 'stop processing', and because it does this, lets it use transfer_messages_to(with delete), which lets certain backends optimise the operation/fixes this groupwise server 'anomily'.

? camel/a.out
? camel/camel-mime-tables.c
? camel/testurl.c
? camel/tests/folder/test10
? camel/tests/folder/test11
? camel/tests/message/test4
? camel/tests/mime-filter/test-tohtml
? camel/tests/misc/test2
? camel/tests/misc/url-scan
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v
retrieving revision 1.2432
diff -u -p -r1.2432 ChangeLog
--- camel/ChangeLog	25 Feb 2005 03:49:26 -0000	1.2432
+++ camel/ChangeLog	28 Feb 2005 04:29:41 -0000
@@ -1,3 +1,10 @@
+2005-02-28  Not Zed  <NotZed Ximian com>
+
+	** See bug #70590
+
+	* camel-filter-driver.c (do_move): Make this copy+delete, and
+	terminate processing implicitly.
+
 2005-02-24  Not Zed  <NotZed Ximian com>
 
 	** See bug #68459
Index: camel/camel-filter-driver.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-filter-driver.c,v
retrieving revision 1.91
diff -u -p -r1.91 camel-filter-driver.c
--- camel/camel-filter-driver.c	1 Feb 2005 02:10:59 -0000	1.91
+++ camel/camel-filter-driver.c	28 Feb 2005 04:29:42 -0000
@@ -516,6 +516,7 @@ do_move (struct _ESExp *f, int argc, str
 			/* open folders we intent to move to */
 			char *folder = argv[i]->value.string;
 			CamelFolder *outbox;
+			int last;
 			
 			outbox = open_folder (driver, folder);
 			if (!outbox)
@@ -523,13 +524,16 @@ do_move (struct _ESExp *f, int argc, str
 			
 			if (outbox == p->source)
 				break;
-			
+
+			/* only delete on last folder (only 1 can ever be supplied by ui currently) */
+			last = (i == argc-1);
+
 			if (!p->modified && p->uid && p->source && camel_folder_has_summary_capability (p->source)) {
 				GPtrArray *uids;
-				
+
 				uids = g_ptr_array_new ();
 				g_ptr_array_add (uids, (char *) p->uid);
-				camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, FALSE, p->ex);
+				camel_folder_transfer_messages_to (p->source, uids, outbox, NULL, last, p->ex);
 				g_ptr_array_free (uids, TRUE);
 			} else {
 				if (p->message == NULL)
@@ -539,19 +543,27 @@ do_move (struct _ESExp *f, int argc, str
 					continue;
 				
 				camel_folder_append_message (outbox, p->message, p->info, NULL, p->ex);
+
+				if (!camel_exception_is_set(p->ex) && last) {
+					if (p->source && p->uid && camel_folder_has_summary_capability (p->source))
+						camel_folder_set_message_flags(p->source, p->uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0);
+					else
+						camel_message_info_set_flags(p->info, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN|CAMEL_MESSAGE_FOLDER_FLAGGED, ~0);
+				}
 			}
 			
 			if (!camel_exception_is_set (p->ex)) {
 				/* a 'move' is a copy & delete */
 				p->copied = TRUE;
-				p->deleted = TRUE;
+				camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Move to folder %s", folder);
 			}
-			
-			camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Move to folder %s",
-						 folder);
 		}
 	}
-	
+
+	/* implicit 'stop' with 'move' */
+	camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Stopped processing");
+	p->terminated = TRUE;
+
 	return NULL;
 }
 


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