aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-remote-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-remote-store.c')
-rw-r--r--camel/camel-remote-store.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c
index 65445189fd..823a4673f4 100644
--- a/camel/camel-remote-store.c
+++ b/camel/camel-remote-store.c
@@ -281,6 +281,16 @@ remote_connect (CamelService *service, CamelException *ex)
return TRUE;
}
+
+static void
+sync_remote_folder (gpointer key, gpointer value, gpointer data)
+{
+ CamelFolder *folder = CAMEL_FOLDER (value);
+
+ if (!camel_exception_is_set ((CamelException *) data))
+ camel_folder_sync (folder, FALSE, (CamelException *) data);
+}
+
static gboolean
remote_disconnect (CamelService *service, gboolean clean, CamelException *ex)
{
@@ -292,6 +302,10 @@ remote_disconnect (CamelService *service, gboolean clean, CamelException *ex)
store->timeout_id = 0;
}
+ if (clean)
+ /* sync all folders */
+ g_hash_table_foreach (CAMEL_STORE (store)->folders, sync_remote_folder, ex);
+
if (!CAMEL_SERVICE_CLASS (store_class)->disconnect (service, clean, ex))
return FALSE;