[evolution-patches] patch to fix #312190 (camel-groupwise)



hi,
The attached patch fixes
http://bugzilla.gnome.org/show_bug.cgi?id=312190

The changes are made in camel-groupwise-folder.c. we have to reset some
flags before we copy the folderInfo.

Thanks,
Vivek Jain
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/ChangeLog,v
retrieving revision 1.76
diff -u -p -r1.76 ChangeLog
--- ChangeLog	1 Aug 2005 07:24:05 -0000	1.76
+++ ChangeLog	2 Aug 2005 04:04:02 -0000
@@ -1,3 +1,11 @@
+2005-08-02 Vivek Jain <jvivek novell com>
+	
+	* camel-groupwise-folder.c: (transfer_messages_to)
+	check for the flags to be reset while transferring to/from junk
+	folder.
+	**Fixes #312190
+	(groupwise_sync): make sure we never call mark_read when list is NULL
+
 2005-08-01  Parthasarathi Susarla <sparthasarathi novell com>
 	
 	* camel-groupwise-store.c:
Index: camel-groupwise-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-folder.c,v
retrieving revision 1.65
diff -u -p -r1.65 camel-groupwise-folder.c
--- camel-groupwise-folder.c	29 Jul 2005 11:38:55 -0000	1.65
+++ camel-groupwise-folder.c	2 Aug 2005 04:04:03 -0000
@@ -502,9 +502,6 @@ move_to_mailbox (CamelFolder *folder, Ca
 	uids = g_ptr_array_new ();
 	g_ptr_array_add (uids, (gpointer) uid);
 	
-	/* make the message as normal one*/
-	camel_folder_set_message_flags (folder, uid, CAMEL_GW_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN, 0);
-
 	dest = camel_store_get_folder (folder->parent_store, "Mailbox", 0, ex);
 	if (dest)
 		groupwise_transfer_messages_to (folder, uids, dest, NULL, TRUE, ex);
@@ -526,8 +523,6 @@ move_to_junk (CamelFolder *folder, Camel
 	uids = g_ptr_array_new ();
 	g_ptr_array_add (uids, (gpointer) uid);
  	
-	camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_JUNK, CAMEL_GW_MESSAGE_JUNK);
-
 	dest = camel_store_get_folder (folder->parent_store, JUNK_FOLDER, 0, NULL);
 	if (dest)
 		groupwise_transfer_messages_to (folder, uids, dest, NULL, TRUE, ex);
@@ -608,7 +603,7 @@ groupwise_sync (CamelFolder *folder, gbo
 		
 	}
 
-	if (read_items) {
+	if (read_items && g_list_length (read_items)) {
 		e_gw_connection_mark_read (cnc, read_items);
 	}
 	if (deleted_items) {
@@ -1600,6 +1595,13 @@ groupwise_transfer_messages_to (CamelFol
 			char **tmp;
 			guint32 temp_flags = 0;
 			CamelGroupwiseMessageInfo *src_info = (CamelGroupwiseMessageInfo *)camel_folder_summary_uid (source->summary, (const char*)uids->pdata[index]);
+			
+			/* we don't want to blindly copy the info: reset some flags not suitable for destination*/
+			if (!g_ascii_strncasecmp(source->full_name, JUNK_FOLDER, 9))
+				camel_folder_set_message_flags (source, old_uid, CAMEL_GW_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK|CAMEL_MESSAGE_JUNK_LEARN, 0);
+			else if (!g_ascii_strncasecmp(destination->full_name, JUNK_FOLDER, 9))
+				camel_folder_set_message_flags (source, old_uid, CAMEL_MESSAGE_JUNK, CAMEL_GW_MESSAGE_JUNK);
+
 			CamelGroupwiseMessageInfo *dest_info = (CamelGroupwiseMessageInfo *)camel_message_info_clone((CamelMessageInfo *)src_info);
 			tmp = g_strsplit (old_uid, ":", -1);
 			dest_info->info.uid = g_strdup_printf ("%s:%s",tmp[0], dest_container_id);


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