Respect the user's namespace override setting. (imap4_get_folder_info):
authorJeffrey Stedfast <fejj@ximian.com>
Mon, 24 Jan 2005 16:57:47 +0000 (16:57 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Mon, 24 Jan 2005 16:57:47 +0000 (16:57 +0000)
2005-01-24  Jeffrey Stedfast  <fejj@ximian.com>

* providers/imap4/camel-imap4-store.c (imap4_get_folder_info):
Respect the user's namespace override setting.
(imap4_get_folder_info): Changed the behaviour a bit to work like
the old imap code: only use the cache if the network is
unavailable, otherwise always scan the server for the folder
listing.

camel/ChangeLog
camel/providers/imap4/camel-imap4-store.c

index ce129ec..8e5ac53 100644 (file)
@@ -2,6 +2,10 @@
 
        * providers/imap4/camel-imap4-store.c (imap4_get_folder_info):
        Respect the user's namespace override setting.
+       (imap4_get_folder_info): Changed the behaviour a bit to work like
+       the old imap code: only use the cache if the network is
+       unavailable, otherwise always scan the server for the folder
+       listing.
 
 2005-01-24  Parthasarathi Susarla <sparthasarathi@novell.com>
 
index 8d435a7..d26c4ce 100644 (file)
@@ -1182,6 +1182,7 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
        
        CAMEL_SERVICE_LOCK (store, connect_lock);
        
+#ifdef USE_FOLDER_INFO_CACHE_LOGIC_FOR_SPEED
        if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL
            || engine->state == CAMEL_IMAP4_ENGINE_DISCONNECTED) {
                fi = camel_imap4_store_summary_get_folder_info (((CamelIMAP4Store *) store)->summary, base, flags);
@@ -1194,6 +1195,16 @@ imap4_get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelE
                CAMEL_SERVICE_UNLOCK (store, connect_lock);
                return fi;
        }
+#else
+       /* this is the way the old imap code was meant to work (except it was broken and disregarded the
+        * NETWORK_UNAVAIL state and went online anyway if fi was NULL, but we won't be evil like that)
+        */
+       if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
+               fi = camel_imap4_store_summary_get_folder_info (((CamelIMAP4Store *) store)->summary, base, flags);
+               CAMEL_SERVICE_UNLOCK (store, connect_lock);
+               return fi;
+       }
+#endif
        
  check_online: