diff options
Diffstat (limited to 'camel/providers/imap4/camel-imap4-folder.c')
-rw-r--r-- | camel/providers/imap4/camel-imap4-folder.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/camel/providers/imap4/camel-imap4-folder.c b/camel/providers/imap4/camel-imap4-folder.c index ebc75330de..ef70c82634 100644 --- a/camel/providers/imap4/camel-imap4-folder.c +++ b/camel/providers/imap4/camel-imap4-folder.c @@ -172,6 +172,7 @@ camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException { CamelIMAP4Folder *imap_folder; char *utf7_name, *name, *p; + CamelFolder *folder; char sep; if (!(p = strrchr (full_name, '/'))) @@ -197,11 +198,23 @@ camel_imap4_folder_new (CamelStore *store, const char *full_name, CamelException utf7_name = camel_utf8_utf7 (utf7_name); - imap_folder = (CamelIMAP4Folder *) camel_object_new (CAMEL_TYPE_IMAP4_FOLDER); - camel_folder_construct ((CamelFolder *) imap_folder, store, full_name, name); + folder = (CamelFolder *) imap_folder = (CamelIMAP4Folder *) camel_object_new (CAMEL_TYPE_IMAP4_FOLDER); + camel_folder_construct (folder, store, full_name, name); imap_folder->utf7_name = utf7_name; - return (CamelFolder *) imap_folder; + folder->summary = camel_imap4_summary_new (folder); + + if (camel_imap4_engine_select_folder (((CamelIMAP4Store *) store)->engine, folder, ex) == -1) { + camel_object_unref (folder); + folder = NULL; + } + + if (camel_imap4_summary_flush_updates (folder->summary, ex) == -1) { + camel_object_unref (folder); + folder = NULL; + } + + return folder; } |