aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-message-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/imap/camel-imap-message-cache.c')
-rw-r--r--camel/providers/imap/camel-imap-message-cache.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c
index 0ac90f7062..a45c039242 100644
--- a/camel/providers/imap/camel-imap-message-cache.c
+++ b/camel/providers/imap/camel-imap-message-cache.c
@@ -275,3 +275,16 @@ camel_imap_message_cache_remove (CamelImapMessageCache *cache, const char *uid)
g_ptr_array_free (subparts, TRUE);
}
+static gboolean
+clear_part (gpointer key, gpointer value, gpointer data)
+{
+ if (!strchr (key, '.'))
+ camel_imap_message_cache_remove (data, key);
+ return TRUE;
+}
+
+void
+camel_imap_message_cache_clear (CamelImapMessageCache *cache)
+{
+ g_hash_table_foreach_remove (cache->parts, clear_part, cache);
+}