aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-folder-cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-folder-cache.c')
-rw-r--r--mail/mail-folder-cache.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 8282625f7d..5742be8e5d 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -1090,3 +1090,32 @@ int mail_note_get_folder_from_uri(const char *uri, CamelFolder **folderp)
return fi.fi != NULL;
}
+
+gboolean
+mail_folder_cache_get_folder_info_flags (CamelFolder *folder, int *flags)
+{
+ char *uri;
+
+ uri = mail_tools_folder_to_url (folder);
+
+ struct _find_info fi = { uri, NULL, NULL };
+
+ if (stores == NULL)
+ return FALSE;
+
+ fi.url = camel_url_new(uri, NULL);
+
+ LOCK(info_lock);
+ g_hash_table_foreach(stores, (GHFunc)storeinfo_find_folder_info, &fi);
+ if (flags) {
+ if (fi.fi) {
+ *flags = fi.fi->flags;
+ }
+ }
+ UNLOCK(info_lock);
+
+ camel_url_free(fi.url);
+ g_free (uri);
+
+ return fi.fi != NULL;
+}