set the service status flag to connected. purge items if it is a Trash
authorParthasarathi Susarla <sparthasarathi@novell.com>
Thu, 4 Aug 2005 09:47:17 +0000 (09:47 +0000)
committerParthasarathi Susarla <saps@src.gnome.org>
Thu, 4 Aug 2005 09:47:17 +0000 (09:47 +0000)
2005-08-04  Parthasarathi Susarla <sparthasarathi@novell.com>

* camel-groupwise-store.c:
(groupwise_connect): set the service status flag to
connected.
* camel-groupwise-folder.c:
(groupwise_expunge): purge items if it is a Trash
Folder.
Fixes Bug ** 311887

camel/providers/groupwise/ChangeLog
camel/providers/groupwise/camel-groupwise-folder.c
camel/providers/groupwise/camel-groupwise-store.c

index c4b02d5..ba4f44d 100644 (file)
@@ -1,3 +1,13 @@
+2005-08-04  Parthasarathi Susarla <sparthasarathi@novell.com>
+
+       * camel-groupwise-store.c:
+       (groupwise_connect): set the service status flag to
+       connected.
+       * camel-groupwise-folder.c:
+       (groupwise_expunge): purge items if it is a Trash 
+       Folder.
+       Fixes Bug ** 311887
+       
 2005-08-03  Parthasarathi Susarla <sparthasarathi@novell.com>
        
        * camel-groupwise-folder.c: 
index 77a205c..4ec691b 100644 (file)
@@ -1656,9 +1656,22 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
        
        CAMEL_SERVICE_LOCK (groupwise_store, connect_lock);
        
-       changes = camel_folder_change_info_new ();
-
        cnc = cnc_lookup (priv);
+       if (!cnc)
+               return;
+
+       if (!strcmp (folder->full_name, "Trash")) {
+               status = e_gw_connection_purge_deleted_items (cnc);
+               if (status == E_GW_CONNECTION_STATUS_OK) {
+                       camel_folder_summary_clear (folder->summary);
+                       camel_folder_summary_save (folder->summary);
+               } else
+                       g_warning ("Could not Empty Trash\n");
+               CAMEL_SERVICE_UNLOCK (groupwise_store, connect_lock);
+               return;
+       }
+       
+       changes = camel_folder_change_info_new ();
        
        container_id =  g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->full_name)) ;
 
index 1afd6e2..c84c5ea 100644 (file)
@@ -257,6 +257,8 @@ groupwise_connect (CamelService *service, CamelException *ex)
                camel_service_disconnect (service, TRUE, NULL);
                return FALSE;
        }
+       
+       service->status = CAMEL_SERVICE_CONNECTED;
 
        if (!e_gw_connection_get_version (priv->cnc)) {
                camel_session_alert_user(session, 
@@ -711,6 +713,8 @@ groupwise_get_folder_info (CamelStore *store, const char *top, guint32 flags, Ca
 
                if (type == E_GW_CONTAINER_TYPE_INBOX)
                        fi->flags |= CAMEL_FOLDER_TYPE_INBOX;
+               if (type == E_GW_CONTAINER_TYPE_TRASH)
+                       fi->flags |= CAMEL_FOLDER_TYPE_TRASH;
 
                if ( (type == E_GW_CONTAINER_TYPE_INBOX) ||
                     (type == E_GW_CONTAINER_TYPE_OUTBOX) ||