[evolution-patches] patch for soap mailer



Hi,
the attached patch fixes the following issues in soap mailer

1. uses the "peek" view in getQuickMessages (fixes 72106)
2. uses removeItemRequest instead of removeItemsRequest 
3. fixes the problem with the percentage summary shown while Fetching
messages

thanks,
partha
Index: camel-groupwise-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-folder.c,v
retrieving revision 1.23
diff -u -p -r1.23 camel-groupwise-folder.c
--- camel-groupwise-folder.c	8 Feb 2005 08:17:26 -0000	1.23
+++ camel-groupwise-folder.c	10 Feb 2005 07:02:20 -0000
@@ -42,6 +42,7 @@
 #include "camel-private.h"
 #include "camel-groupwise-private.h"
 #include "camel-groupwise-journal.h"
+#include "camel-groupwise-utils.h"
 #include "camel-stream-mem.h"
 #include <e-gw-connection.h>
 #include <e-gw-item.h>
@@ -625,7 +626,7 @@ groupwise_refresh_info(CamelFolder *fold
 	CAMEL_SERVICE_LOCK (gw_store, connect_lock);
 
 	status = e_gw_connection_get_quick_messages (cnc, container_id,
-					"distribution created attachments subject",
+					"peek distribution created attachments subject",
 					time_string, "New", "Mail", NULL, -1, &slist) ;
 	if (status != E_GW_CONNECTION_STATUS_OK) {
 		camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
@@ -729,10 +730,8 @@ gw_update_summary ( CamelFolder *folder,
 			}
 
 			temp_date = e_gw_item_get_creation_date(item) ;
-			if (temp_date) {
-				date = e_gw_connection_format_date_string(temp_date) ;
-				mi->info.date_sent = mi->info.date_received = e_gw_connection_get_date_from_string (date) ;
-			}
+			if (temp_date) 
+				mi->info.date_sent = mi->info.date_received = e_gw_connection_get_date_from_string (temp_date) ;
 			mi->info.uid = g_strdup (e_gw_item_get_id (item)) ;
 			mi->info.subject = g_strdup (e_gw_item_get_subject(item)) ;
 
@@ -935,8 +934,8 @@ groupwise_expunge (CamelFolder *folder, 
 	EGwConnection *cnc;
 	EGwConnectionStatus status ;
 	CamelFolderChangeInfo *changes ;
-	GList *l, *n, *item_ids = NULL;
 	int i, max;
+	gboolean delete = FALSE ;
 	
 	CAMEL_SERVICE_LOCK (groupwise_store, connect_lock);
 	
@@ -944,30 +943,25 @@ groupwise_expunge (CamelFolder *folder, 
 
 	cnc = cnc_lookup (priv) ;
 	
+	container_id =  g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->name)) ;
+
 	max = camel_folder_summary_count (folder->summary);
 	for (i = 0; i < max; i++) {
 		info = camel_folder_summary_index (folder->summary, i);
 		ginfo = (CamelGroupwiseMessageInfo *) info;
 		if (ginfo->info.flags & CAMEL_MESSAGE_DELETED) {
-			item_ids = g_list_append (item_ids, g_strdup (camel_message_info_uid (info)));
-			camel_folder_change_info_remove_uid (changes, (char *) item_ids->data);
+			const char *uid = camel_message_info_uid (info) ;
+			status = e_gw_connection_remove_item (cnc, container_id, uid);
+			if (status == E_GW_CONNECTION_STATUS_OK) {
+				camel_folder_change_info_remove_uid (changes, (char *) uid);
+				delete = TRUE ;
+			}
 		}
 		camel_message_info_free (info);
 	}
-	
-	container_id =  g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->name)) ;
-	status = e_gw_connection_remove_items (cnc, container_id, item_ids);
-	if (status == E_GW_CONNECTION_STATUS_OK)
-		camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
-	else
-		g_print ("ERROR!!! Could not delete items\n") ;
-	
-	l = item_ids;
-	while (l != NULL) {
-		n = l->next;
-		g_list_free_1 (l);
-		l = n;
-	}
+
+	if (delete)
+		camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes) ;
 	
 	CAMEL_SERVICE_UNLOCK (groupwise_store, connect_lock);
 	
Index: camel-groupwise-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-store.c,v
retrieving revision 1.28
diff -u -p -r1.28 camel-groupwise-store.c
--- camel-groupwise-store.c	9 Feb 2005 08:24:27 -0000	1.28
+++ camel-groupwise-store.c	10 Feb 2005 07:02:21 -0000
@@ -551,7 +551,7 @@ groupwise_get_folder (CamelStore *store,
 		camel_operation_start (NULL, _("Fetching summary information for new messages"));
 
 		status = e_gw_connection_get_quick_messages (priv->cnc, container_id,
-				"distribution attachments subject created",
+				"peek distribution attachments subject created",
 				time_string, "New", "Mail", NULL, -1, &slist) ;
 		if (status != E_GW_CONNECTION_STATUS_OK) {
 			//camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
@@ -577,7 +577,7 @@ groupwise_get_folder (CamelStore *store,
 		g_mutex_lock (mutex) ;
 
 		status = e_gw_connection_create_cursor (priv->cnc, container_id, 
-				"attachments distribution created subject",
+				"peek attachments distribution created subject",
 				NULL,
 				&cursor) ;
 		if (status != E_GW_CONNECTION_STATUS_OK) {
@@ -619,9 +619,9 @@ groupwise_get_folder (CamelStore *store,
 			if (temp == count)
 				camel_operation_progress (NULL, 0) ;
 			if (temp < count)
-				camel_operation_progress (NULL, temp * 100/count) ;
+				camel_operation_progress (NULL, 100 - (temp * 100/count)) ;
 			if (temp >count)
-				camel_operation_progress (NULL, count * 100/temp) ;
+				camel_operation_progress (NULL, 100 - (count * 100/temp)) ;
 			if (!list  || temp == 0)
 				done = TRUE;
 			g_list_free (list);


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