[geary/geary-0.13] Merge branch 'wip/301-auth-errors' into 'master'



commit c2415c7c6dcee106fdf5cb3bf5b66d973ef4677f
Author: Michael Gratton <mike vee net>
Date:   Sat Mar 9 03:19:15 2019 +0000

    Merge branch 'wip/301-auth-errors' into 'master'
    
    Fix SMTP auth errors when using IMAP credentials
    
    See merge request GNOME/geary!168
    
    (cherry picked from commit 5c7999c69da73887534a6ae2e998e5764cd75fb6)
    
    cd8ed405 Fix SMTP auth errors when using IMAP credentials

 src/engine/api/geary-account-information.vala | 32 +++++++++++++++++----------
 1 file changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/src/engine/api/geary-account-information.vala b/src/engine/api/geary-account-information.vala
index 89b83363..980ef711 100644
--- a/src/engine/api/geary-account-information.vala
+++ b/src/engine/api/geary-account-information.vala
@@ -466,41 +466,49 @@ public class Geary.AccountInformation : BaseObject {
     }
 
     /**
-     * Loads this account's outgoing service credentials, if needed.
+     * Loads the authentication token for the outgoing service.
      *
      * Credentials are loaded from the mediator, thus it may yield for
      * some time.
      *
-     * Returns true if the credentials were successfully loaded, or
-     * false if the credentials could not be loaded and the service's
+     * Returns true if the credential's token was successfully loaded
+     * or are not needed (that is, if the credentials are null), or
+     * false if the token could not be loaded and the service's
      * credentials are invalid.
      */
     public async bool load_outgoing_credentials(GLib.Cancellable? cancellable)
         throws GLib.Error {
-        Credentials? creds = this.outgoing.credentials;
-        bool loaded = false;
+        Credentials? creds = get_outgoing_credentials();
+        bool loaded = true;
         if (creds != null) {
-            loaded = yield this.mediator.load_token(
-                this, this.outgoing, cancellable
-            );
+            if (this.outgoing.credentials_requirement == USE_INCOMING) {
+                loaded = yield this.mediator.load_token(
+                    this, this.incoming, cancellable
+                );
+            } else {
+                loaded = yield this.mediator.load_token(
+                    this, this.outgoing, cancellable
+                );
+            }
         }
         return loaded;
     }
 
     /**
-     * Loads this account's incoming service credentials, if needed.
+     * Loads the authentication token for the incoming service.
      *
      * Credentials are loaded from the mediator, thus it may yield for
      * some time.
      *
-     * Returns true if the credentials were successfully loaded, or
-     * false if the credentials could not be loaded and the service's
+     * Returns true if the credential's token was successfully loaded
+     * or are not needed (that is, if the credentials are null), or
+     * false if the token could not be loaded and the service's
      * credentials are invalid.
      */
     public async bool load_incoming_credentials(GLib.Cancellable? cancellable)
         throws GLib.Error {
         Credentials? creds = this.incoming.credentials;
-        bool loaded = false;
+        bool loaded = true;
         if (creds != null) {
             loaded = yield this.mediator.load_token(
                 this, this.incoming, cancellable


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