[geary: 4/6] Prefill postman queue only after account has been opened. Bug 727679.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 4/6] Prefill postman queue only after account has been opened. Bug 727679.
- Date: Thu, 26 Oct 2017 07:37:15 +0000 (UTC)
commit 08a706b05a9118f8e0d077450d5bdbbc424496f2
Author: Michael Gratton <mike vee net>
Date: Sat Dec 6 15:55:53 2014 +1100
Prefill postman queue only after account has been opened. Bug 727679.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala
(Geary.SmtpOutboxFolder.SmtpOutboxFolder): Prefil on account start.
(Geary.SmtpOutboxFolder.do_postman_async): Split queue prefil code into
new fill_outbox_queue method.
src/engine/imap-db/outbox/smtp-outbox-folder.vala | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/engine/imap-db/outbox/smtp-outbox-folder.vala
b/src/engine/imap-db/outbox/smtp-outbox-folder.vala
index 9ed9a97..926ed95 100644
--- a/src/engine/imap-db/outbox/smtp-outbox-folder.vala
+++ b/src/engine/imap-db/outbox/smtp-outbox-folder.vala
@@ -74,6 +74,7 @@ private class Geary.SmtpOutboxFolder : Geary.AbstractLocalFolder, Geary.FolderSu
this.db = db;
_account = account;
+ _account.opened.connect(() => { this.fill_outbox_queue.begin(); });
this.sending_monitor = sending_monitor;
smtp = new Geary.Smtp.ClientSession(_account.information.get_smtp_endpoint());
@@ -133,13 +134,11 @@ private class Geary.SmtpOutboxFolder : Geary.AbstractLocalFolder, Geary.FolderSu
return (message.subject != null && !String.is_empty(message.subject.to_string()))
? message.subject.to_string() : "(no subject)";
}
-
- // TODO: Use Cancellable to shut down outbox processor when closing account
- private async void do_postman_async() {
- debug("Starting outbox postman");
- uint send_retry_seconds = MIN_SEND_RETRY_INTERVAL_SEC;
-
- // Fill the send queue with existing mail (if any)
+
+
+ // Fill the send queue with existing mail (if any)
+ private async void fill_outbox_queue() {
+ debug("Filling outbox queue");
try {
Gee.ArrayList<OutboxRow> list = new Gee.ArrayList<OutboxRow>();
yield db.exec_transaction_async(Db.TransactionType.RO, (cx, cancellable) => {
@@ -171,6 +170,13 @@ private class Geary.SmtpOutboxFolder : Geary.AbstractLocalFolder, Geary.FolderSu
} catch (Error prime_err) {
warning("Error priming outbox: %s", prime_err.message);
}
+ }
+
+
+ // TODO: Use Cancellable to shut down outbox processor when closing account
+ private async void do_postman_async() {
+ debug("Starting outbox postman");
+ uint send_retry_seconds = MIN_SEND_RETRY_INTERVAL_SEC;
// Start the send queue.
for (;;) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]