[geary/wip/conversation-polish: 14/22] Fix email remote loaded by FetchEmail replay op not having attachments



commit 74153a223461cdf838f5ae71a1b5ff5b878d2bf1
Author: Michael Gratton <mike vee net>
Date:   Thu Jan 24 18:50:48 2019 +1100

    Fix email remote loaded by FetchEmail replay op not having attachments
    
    Need to always re-load from the local since that creates attachment
    objects for email.

 .../imap-engine/replay-ops/imap-engine-fetch-email.vala   | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala 
b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
index fcbc3012..6c0d21bb 100644
--- a/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
+++ b/src/engine/imap-engine/replay-ops/imap-engine-fetch-email.vala
@@ -120,14 +120,13 @@ private class Geary.ImapEngine.FetchEmail : Geary.ImapEngine.SendReplayOperation
             engine.replay_notify_email_inserted(ids);
             engine.replay_notify_email_locally_inserted(ids);
         }
-        
-        // if remote_email doesn't fulfill all required, pull from local database, which should now
-        // be able to do all of that
-        if (!email.fields.fulfills(required_fields)) {
-            email = yield engine.local_folder.fetch_email_async(id, required_fields,
-                ImapDB.Folder.ListFlags.NONE, cancellable);
-            assert(email != null);
-        }
+
+        // Finally, pull again from the local database, to get the
+        // full set of required fields, and ensure attachments are
+        // created, if needed.
+        this.email = yield this.engine.local_folder.fetch_email_async(
+            this.id, this.required_fields, NONE, this.cancellable
+        );
     }
 
     public override string describe_state() {


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