[geary: 13/13] Merge branch 'buzzert/deleted_flags' into 'master'



commit 35150701e3db0722447152bbe87928306b0daf11
Merge: 4b3c1676 d694e849
Author: Michael Gratton <mike vee net>
Date:   Sat Feb 2 02:47:46 2019 +0000

    Merge branch 'buzzert/deleted_flags' into 'master'
    
    Fixes bug where messages marked for deletion still appear in message list
    
    See merge request GNOME/geary!54

 src/engine/api/geary-email-flags.vala              |  8 ++++
 src/engine/app/app-conversation-monitor.vala       | 53 +++++++++++++++++++++-
 src/engine/app/app-conversation.vala               | 20 +++++++-
 .../conversation-monitor/app-conversation-set.vala |  9 +++-
 src/engine/imap/api/imap-email-flags.vala          |  9 ++++
 src/engine/imap/message/imap-message-flag.vala     |  4 ++
 test/engine/app/app-conversation-monitor-test.vala | 25 ++++++++++
 test/engine/app/app-conversation-test.vala         | 14 ++++++
 8 files changed, 138 insertions(+), 4 deletions(-)
---
diff --cc src/engine/app/app-conversation.vala
index 63d52da8,c929f436..40d88d89
--- a/src/engine/app/app-conversation.vala
+++ b/src/engine/app/app-conversation.vala
@@@ -180,18 -180,29 +180,29 @@@ public class Geary.App.Conversation : B
          return get_single_email(Ordering.RECV_DATE_DESCENDING, location);
      }
  
+     public Gee.Collection<Email>
+         get_emails_flagged_for_deletion(Location location,
+                                         Gee.Collection<FolderPath>? blacklist = null) {
+         Gee.Collection<Email> emails = get_emails(Ordering.NONE, location, blacklist, false);
+         Iterable<Email> filtered = traverse<Email>(emails);
+         return filtered.filter(
+             (e) => e.email_flags.is_deleted()
+         ).to_array_list();
+     }
+ 
      /**
 -     * Returns all the email in the conversation sorted and filtered according to the specifiers.
 +     * Returns the conversation's email, possibly sorted and filtered.
       *
       * {@link Location.IN_FOLDER} and {@link Location.OUT_OF_FOLDER} are the
       * only preferences honored; the others ({@link Location.IN_FOLDER_OUT_OF_FOLDER},
       * {@link Location.IN_FOLDER_OUT_OF_FOLDER}, and {@link Location.ANYWHERE}
       * are all treated as ANYWHERE.
       */
 -    public Gee.Collection<Email>
 +    public Gee.List<Email>
          get_emails(Ordering ordering,
                     Location location = Location.ANYWHERE,
-                    Gee.Collection<FolderPath>? blacklist = null) {
+                    Gee.Collection<FolderPath>? blacklist = null,
+                    bool filter_deleted = true) {
          Gee.Collection<Email> email;
          switch (ordering) {
              case Ordering.SENT_DATE_ASCENDING:


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