[geary: 1/2] conversation-list: hack: don't expand non-interesting mails



commit d3835617b20049cc5e145af03f7a24f4f16a26c0
Author: Konstantin Kharlamov <Hi-Angel yandex ru>
Date:   Sun Apr 21 05:04:19 2019 +0300

    conversation-list: hack: don't expand non-interesting mails
    
    When mails weren't loaded from database, conversation list may happen to
    load mails through load_full_email function, which expands mails by
    default.
    
    Ideally this function shouldn't be called for these mails, but correct
    solution would require to store conversation in database, for now lets
    work around it by simply checking whether a mail needs to be expanded.
    
    Fixes https://gitlab.gnome.org/GNOME/geary/issues/396
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel yandex ru>

 src/client/conversation-viewer/conversation-list-box.vala | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-list-box.vala 
b/src/client/conversation-viewer/conversation-list-box.vala
index 42aef4be..39333946 100644
--- a/src/client/conversation-viewer/conversation-list-box.vala
+++ b/src/client/conversation-viewer/conversation-list-box.vala
@@ -612,8 +612,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
             new Gee.LinkedList<Geary.Email>();
         foreach (Geary.Email email in all_email) {
             if (first_interesting == null) {
-                if (email.is_unread().is_certain() ||
-                    email.is_flagged().is_certain()) {
+                if (is_interesting(email)) {
                     first_interesting = email;
                 } else {
                     // Inserted reversed so most recent uninteresting
@@ -899,7 +898,9 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
         if (!this.cancellable.is_cancelled()) {
             EmailRow row = add_email(full_email);
             yield row.view.load_contacts();
-            yield row.expand();
+            if (is_interesting(full_email)) {
+                yield row.expand();
+            }
             this.search.highlight_row_if_matching(row);
         }
     }


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