[geary/wip/778276-better-flag-updates: 20/25] Don't sync on email send, sync when sent mail is saved.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/778276-better-flag-updates: 20/25] Don't sync on email send, sync when sent mail is saved.
- Date: Mon, 18 Dec 2017 22:43:58 +0000 (UTC)
commit edd817240e9f7c2e473d588275b73dd43e20d6e2
Author: Michael James Gratton <mike vee net>
Date: Tue Nov 28 10:22:06 2017 +1100
Don't sync on email send, sync when sent mail is saved.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
(MinimalFolder::create_email_async): Send folders-contents-altered when
we have created a message.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer): Don't bother synchronising mail on send, since
we'll now get a folders-contents-altered signal when it's actually
saved instead.
.../imap-engine-account-synchronizer.vala | 13 +------------
.../imap-engine/imap-engine-minimal-folder.vala | 4 +++-
2 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-account-synchronizer.vala
b/src/engine/imap-engine/imap-engine-account-synchronizer.vala
index b8dd07b..274b145 100644
--- a/src/engine/imap-engine/imap-engine-account-synchronizer.vala
+++ b/src/engine/imap-engine/imap-engine-account-synchronizer.vala
@@ -35,7 +35,6 @@ private class Geary.ImapEngine.AccountSynchronizer : Geary.BaseObject {
this.account.information.notify["prefetch-period-days"].connect(on_account_prefetch_changed);
this.account.folders_available_unavailable.connect(on_folders_available_unavailable);
this.account.folders_contents_altered.connect(on_folders_contents_altered);
- this.account.email_sent.connect(on_email_sent);
this.remote.ready.connect(on_account_ready);
}
@@ -86,17 +85,7 @@ private class Geary.ImapEngine.AccountSynchronizer : Geary.BaseObject {
private void on_folders_contents_altered(Gee.Collection<Folder> altered) {
delayed_send_all(altered, false, SYNC_DELAY_SEC);
}
-
- private void on_email_sent() {
- try {
- Folder? sent_mail = account.get_special_folder(SpecialFolderType.SENT);
- if (sent_mail != null)
- send_all(iterate<Folder>(sent_mail).to_array_list(), false);
- } catch (Error err) {
- debug("Unable to retrieve Sent Mail from %s: %s", account.to_string(), err.message);
- }
- }
-
+
private void delayed_send_all(Gee.Collection<Folder> folders, bool reason_available, int sec) {
Timeout.add_seconds(sec, () => {
// remove any unavailable folders
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index b79ff83..f0bb6e1 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -1579,7 +1579,9 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
// safely back out.
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);
+
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]