[geary/wip/actually-imap-logout: 1107/1111] Disconnect and signal logout once the command successfully completed



commit 3f9be2c0993baa665297adfd680925139cd217d9
Author: Michael Gratton <mike vee net>
Date:   Thu Feb 7 14:01:17 2019 +1100

    Disconnect and signal logout once the command successfully completed

 src/engine/imap/transport/imap-client-session.vala | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/engine/imap/transport/imap-client-session.vala 
b/src/engine/imap/transport/imap-client-session.vala
index 3f1bc598..53b24bf9 100644
--- a/src/engine/imap/transport/imap-client-session.vala
+++ b/src/engine/imap/transport/imap-client-session.vala
@@ -1540,8 +1540,17 @@ public class Geary.Imap.ClientSession : BaseObject {
         if (params.err != null)
             throw params.err;
 
-        if(params.proceed)
+        if (params.proceed) {
             yield command_transaction_async(cmd, cancellable);
+            logged_out();
+            this.cx.disconnect_async.begin(
+                cancellable, (obj, res) => {
+                    dispatch_disconnect_results(
+                        DisconnectReason.LOCAL_CLOSE, res
+                    );
+                }
+            );
+        }
     }
 
     private uint on_logout(uint state, uint event, void *user, Object? object) {
@@ -1591,8 +1600,6 @@ public class Geary.Imap.ClientSession : BaseObject {
         if (!validate_state_change_cmd(completion_response))
             return state;
 
-        fsm.do_post_transition(() => { logged_out(); });
-
         return State.LOGGED_OUT;
     }
 


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