[geary/wip/fix-not-prompting-for-missing-password: 4/5] Ensure AccountInformation load credentials methods always (re)load them
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/fix-not-prompting-for-missing-password: 4/5] Ensure AccountInformation load credentials methods always (re)load them
- Date: Thu, 21 Feb 2019 03:36:20 +0000 (UTC)
commit f59fdd050a6b2b7c08208bbf22649fb21b09a06b
Author: Michael Gratton <mike vee net>
Date: Thu Feb 21 14:27:16 2019 +1100
Ensure AccountInformation load credentials methods always (re)load them
This prevents exising-but-expired tokens preventing new tokens from
being loaded.
Fixes #249 for GOA accounts
src/engine/api/geary-account-information.vala | 31 ++++++---------------------
1 file changed, 7 insertions(+), 24 deletions(-)
---
diff --git a/src/engine/api/geary-account-information.vala b/src/engine/api/geary-account-information.vala
index 4efeab59..c0d0c74e 100644
--- a/src/engine/api/geary-account-information.vala
+++ b/src/engine/api/geary-account-information.vala
@@ -470,21 +470,12 @@ public class Geary.AccountInformation : BaseObject {
* been previously loaded, or false the credentials could not be
* loaded and the service's credentials are invalid.
*/
- public async bool load_outgoing_credentials(GLib.Cancellable? cancellable)
+ public async void load_outgoing_credentials(GLib.Cancellable? cancellable)
throws GLib.Error {
- Credentials? creds = get_outgoing_credentials();
- bool loaded = (creds == null || creds.is_complete());
- if (!loaded && creds != null) {
- ServiceInformation service = this.outgoing;
- if (this.outgoing.credentials_requirement ==
- Credentials.Requirement.USE_INCOMING) {
- service = this.incoming;
- }
- loaded = yield this.mediator.load_token(
- this, service, cancellable
- );
+ Credentials? creds = this.outgoing.credentials;
+ if (creds != null) {
+ yield this.mediator.load_token(this, this.outgoing, cancellable);
}
- return loaded;
}
/**
@@ -493,21 +484,13 @@ public class Geary.AccountInformation : BaseObject {
* Credentials are loaded from the mediator, which may cause the
* user to be prompted for the secret, thus it may yield for some
* time.
- *
- * Returns true if the credentials were successfully loaded or had
- * been previously loaded, or false the credentials could not be
- * loaded and the service's credentials are invalid.
*/
- public async bool load_incoming_credentials(GLib.Cancellable? cancellable)
+ public async void load_incoming_credentials(GLib.Cancellable? cancellable)
throws GLib.Error {
Credentials? creds = this.incoming.credentials;
- bool loaded = creds.is_complete();
- if (!loaded) {
- loaded = yield this.mediator.load_token(
- this, this.incoming, cancellable
- );
+ if (creds != null) {
+ yield this.mediator.load_token(this, this.incoming, cancellable);
}
- return loaded;
}
public bool equal_to(AccountInformation other) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]