[evolution-kolab] KolabMailAccess: need to down-sync folder info before creating new folder



commit f0757d17501d4b3ed6a7d3e504c361427bbbcd04
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Sep 18 10:45:40 2012 +0200

    KolabMailAccess: need to down-sync folder info before creating new folder
    
    * when creating a new PIM folder, we require online operational
      mode, so we can simply down-sync folder information from the
      server before creating a new folder
    * this will update the folder information in the local InfoDb,
      which we then query for folder existence
    * updating the InfoDb just before querying for folder existence
      somewhat reduces the inherent raciness of folder creation
      (and type setting)

 src/libekolab/kolab-mail-access.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libekolab/kolab-mail-access.c b/src/libekolab/kolab-mail-access.c
index f07069e..80259c5 100644
--- a/src/libekolab/kolab-mail-access.c
+++ b/src/libekolab/kolab-mail-access.c
@@ -3035,6 +3035,16 @@ kolab_mail_access_create_source (KolabMailAccess *self,
 		goto exit;
 	}
 
+	/* folder info update */
+	ok = mail_access_sync_with_server (self,
+	                                   KOLAB_MAIL_ACCESS_OPMODE_ONLINE,
+	                                   NULL,  /* NULL means all folders */
+	                                   FALSE, /* folder info only */
+	                                   cancellable,
+	                                   &tmp_err);
+	if (! ok)
+		goto exit;
+
 	/* check whether folder exists */
 	exists = kolab_mail_info_db_exists_foldername (priv->infodb,
 	                                               sourcename,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]