[geary/wip/email-flag-refinement-redux: 14/14] Add Email.Field.FIELDS to ImapDb.Folder.REQUIRED_FIELDS



commit e3397cb0bc93e0b99200ccc5062b99536ecc0adb
Author: Michael Gratton <mike vee net>
Date:   Fri Feb 15 01:25:26 2019 +1100

    Add Email.Field.FIELDS to ImapDb.Folder.REQUIRED_FIELDS
    
    This is especially needed since when moving a message from one folder to
    another, the copy's flags are will un-flag it as deleted, so it actually
    shows up again in conversations after the MoveEmailCommit op deletes the
    original in the source folder.
    
    This also has the extra benefit however of makig sure the engine knows
    up-front what the uread state of all new mail is, and hence might
    actaully get unread counts correct.

 src/engine/imap-db/imap-db-folder.vala | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/imap-db/imap-db-folder.vala b/src/engine/imap-db/imap-db-folder.vala
index 904fead9..53f8c5fb 100644
--- a/src/engine/imap-db/imap-db-folder.vala
+++ b/src/engine/imap-db/imap-db-folder.vala
@@ -20,7 +20,16 @@ private class Geary.ImapDB.Folder : BaseObject, Geary.ReferenceSemantics {
     /**
      * Fields required for a message to be stored in the database.
      */
-    public const Geary.Email.Field REQUIRED_FIELDS = Geary.Email.Field.PROPERTIES|Email.Field.REFERENCES;
+    public const Geary.Email.Field REQUIRED_FIELDS = (
+        // Required for primary duplicate detection done with properties
+        Email.Field.PROPERTIES |
+        // Required for secondary duplicate detection via UID
+        Email.Field.REFERENCES |
+        // Required to ensure the unread count is up to date and so
+        // that when moving a message, the new copy turns back up as
+        // being not deleted.
+        Email.Field.FLAGS
+    );
 
     /**
      * Fields required for a message to be considered for full-text indexing.


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