[evolution/gnome-3-20] Recognize special folders for a global mail view also based on flags



commit 7323e89361f5a231a6e1512b0acd94dc1bec4a03
Author: Milan Crha <mcrha redhat com>
Date:   Wed May 4 17:23:51 2016 +0200

    Recognize special folders for a global mail view also based on flags
    
    Folders which are reported as Sent or Outbox with their folder info
    flags only were not recognized for proper global folder view. That
    made for example show a From column, instead of the To column, where
    the former is rather useless in the Sent or Outbox folders.
    
    This had been reported at:
    https://bugzilla.redhat.com/show_bug.cgi?id=1332754

 mail/e-mail-paned-view.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/mail/e-mail-paned-view.c b/mail/e-mail-paned-view.c
index ca77283..6e606fd 100644
--- a/mail/e-mail-paned-view.c
+++ b/mail/e-mail-paned-view.c
@@ -854,6 +854,8 @@ mail_paned_view_update_view_instance (EMailView *view)
        ESourceRegistry *registry;
        GalViewCollection *view_collection;
        GalViewInstance *view_instance;
+       MailFolderCache *folder_cache;
+       CamelFolderInfoFlags info_flags;
        CamelFolder *folder;
        GtkOrientable *orientable;
        GtkOrientation orientation;
@@ -888,7 +890,15 @@ mail_paned_view_update_view_instance (EMailView *view)
        view_id = empv_create_view_id (folder);
        e_filename_make_safe (view_id);
 
+       folder_cache = e_mail_session_get_folder_cache (e_mail_backend_get_session (e_mail_reader_get_backend 
(reader)));
+       if (!mail_folder_cache_get_folder_info_flags (folder_cache,
+               camel_folder_get_parent_store (folder),
+               camel_folder_get_full_name (folder), &info_flags))
+               info_flags = 0;
+
        outgoing_folder =
+               (info_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_OUTBOX ||
+               (info_flags & CAMEL_FOLDER_TYPE_MASK) == CAMEL_FOLDER_TYPE_SENT ||
                em_utils_folder_is_drafts (registry, folder) ||
                em_utils_folder_is_outbox (registry, folder) ||
                em_utils_folder_is_sent (registry, folder);


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