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.
This commit is contained in:
Michael Gratton 2019-02-15 01:25:26 +11:00 committed by Michael James Gratton
parent 0d3733b025
commit 272d95e36a

View file

@ -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.