[geary/mjog/invert-folder-class-hierarchy: 337/362] Geary.ImapEngine.MinimalFolder: Throw an error opening remote if offline




commit c9cb0893423d23834b302ebb4b4ea2028274c9b4
Author: Michael Gratton <mike vee net>
Date:   Tue Feb 16 09:16:15 2021 +1100

    Geary.ImapEngine.MinimalFolder: Throw an error opening remote if offline
    
    Don't let `open_remote_session()` attempt to go ahead if offline, it
    won't work.

 src/engine/imap-engine/imap-engine-minimal-folder.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala 
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index 1b952185d..3c0c4a1b3 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -346,6 +346,10 @@ private class Geary.ImapEngine.MinimalFolder : BaseObject,
 
     private async void open_remote_session(GLib.Cancellable? cancellable = null)
         throws GLib.Error {
+        if (this._account.imap.current_status != CONNECTED) {
+            throw new EngineError.SERVER_UNAVAILABLE("Not IMAP not connected");
+        }
+
         lock (this.remote_session) {
             if (this.remote_session == null) {
                 yield open_remote_locked(cancellable);


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