[geary/wip/131-sent-mail: 7/14] Ensure folder is refreshed ASAP after creating a new message
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/131-sent-mail: 7/14] Ensure folder is refreshed ASAP after creating a new message
- Date: Sat, 10 Aug 2019 02:14:45 +0000 (UTC)
commit af01f9837e02172e6e8ff726a1d03eafc75c0b02
Author: Michael Gratton <mike vee net>
Date: Thu Aug 8 23:08:56 2019 +1000
Ensure folder is refreshed ASAP after creating a new message
If the server supports UID plus, update the message after it was
created to get its IMAP fields and anything else missing filled in.
If not, schedule a explicit folder sync.
src/engine/imap-engine/imap-engine-minimal-folder.vala | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
---
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index a49f4596..be61c619 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -1468,7 +1468,19 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
if (cancellable != null && cancellable.is_cancelled() && ret != null && remove_folder != null)
yield remove_folder.remove_email_async(iterate<EmailIdentifier>(ret).to_array_list());
- this._account.update_folder(this);
+ if (ret != null) {
+ // Server returned a UID for the new message. It was saved
+ // locally possibly before the server notified that the
+ // message exists. As such, fetch any missing parts from
+ // the remote to ensure it is properly filled in.
+ yield list_email_by_id_async(
+ ret, 1, ALL, INCLUDING_ID, cancellable
+ );
+ } else {
+ // The server didn't return a UID for the new email, so do
+ // a sync now to ensure it shows up immediately.
+ yield synchronise_remote(cancellable);
+ }
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]