[evolution-data-server] [IMAPx] Unsubscribed folders shown after refresh



commit 28b14790ec6fc358d5cc5c5edf9fc1bdc0f4f785
Author: Milan Crha <mcrha redhat com>
Date:   Wed Apr 12 16:18:26 2017 +0200

    [IMAPx] Unsubscribed folders shown after refresh
    
    When using "Show only subscribed folders", the UI could show unsubscribed
    folders when the list of folders had been refreshed, due to emitting
    'subscribed' signal for these unsubscribed folders unconditionally.

 src/camel/providers/imapx/camel-imapx-store.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-store.c b/src/camel/providers/imapx/camel-imapx-store.c
index 72c7571..8f2b868 100644
--- a/src/camel/providers/imapx/camel-imapx-store.c
+++ b/src/camel/providers/imapx/camel-imapx-store.c
@@ -1489,14 +1489,21 @@ imapx_store_remove_unknown_mailboxes_cb (gpointer key,
        g_return_val_if_fail (CAMEL_IS_IMAPX_STORE (imapx_store), FALSE);
 
        if (camel_imapx_mailbox_get_state (mailbox) == CAMEL_IMAPX_MAILBOX_STATE_CREATED) {
+               CamelSettings *settings;
                CamelFolderInfo *fi;
                gchar *folder_path;
+               gboolean use_subscriptions;
+
+               settings = camel_service_ref_settings (CAMEL_SERVICE (imapx_store));
+               use_subscriptions = camel_imapx_settings_get_use_subscriptions (CAMEL_IMAPX_SETTINGS 
(settings));
+               g_object_unref (settings);
 
                folder_path = camel_imapx_mailbox_dup_folder_path (mailbox);
                fi = imapx_store_build_folder_info (imapx_store, folder_path,
                        (CamelFolderInfoFlags) imapx_store_mailbox_attributes_to_flags (mailbox));
                camel_store_folder_created (CAMEL_STORE (imapx_store), fi);
-               camel_subscribable_folder_subscribed (CAMEL_SUBSCRIBABLE (imapx_store), fi);
+               if ((fi->flags & CAMEL_STORE_INFO_FOLDER_SUBSCRIBED) != 0 || !use_subscriptions)
+                       camel_subscribable_folder_subscribed (CAMEL_SUBSCRIBABLE (imapx_store), fi);
                camel_folder_info_free (fi);
                g_free (folder_path);
        }


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