[evolution-data-server/gnome-3-32] evo-I#479 - Call mail account refresh also after going online ][



commit 18788af180aea611c7fc47011203caae8e9972cf
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 27 18:59:03 2019 +0200

    evo-I#479 - Call mail account refresh also after going online ][
    
    The CamelOfflineStore did not reconnect once it disconnected, only
    after whole CamelSession went offline and online.
    
    Related to https://gitlab.gnome.org/GNOME/evolution/issues/479

 src/camel/camel-offline-store.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/camel/camel-offline-store.c b/src/camel/camel-offline-store.c
index d14929858..09f8b54cc 100644
--- a/src/camel/camel-offline-store.c
+++ b/src/camel/camel-offline-store.c
@@ -155,12 +155,7 @@ offline_store_notify (GObject *object,
                g_object_notify (object, "online");
        else if (g_strcmp0 (pspec->name, "connection-status") == 0 &&
                 camel_service_get_connection_status (CAMEL_SERVICE (object)) == CAMEL_SERVICE_DISCONNECTED) {
-               CamelOfflineStore *store = CAMEL_OFFLINE_STORE (object);
-
-               if (store->priv->online) {
-                       store->priv->online = FALSE;
-                       g_object_notify (object, "online");
-               }
+               g_object_notify (object, "online");
        }
 
        /* Chain up to parent's notify() method. */
@@ -253,8 +248,10 @@ camel_offline_store_set_online_sync (CamelOfflineStore *store,
 
        g_return_val_if_fail (CAMEL_IS_OFFLINE_STORE (store), FALSE);
 
-       if (camel_offline_store_get_online (store) == online)
+       if (camel_offline_store_get_online (store) == online && (!online ||
+           camel_service_get_connection_status (CAMEL_SERVICE (store)) == CAMEL_SERVICE_CONNECTED)) {
                return TRUE;
+       }
 
        service = CAMEL_SERVICE (store);
 
@@ -273,7 +270,8 @@ camel_offline_store_set_online_sync (CamelOfflineStore *store,
                                CAMEL_NETWORK_SERVICE (store));
        }
 
-       store_is_online = camel_offline_store_get_online (store);
+       store_is_online = camel_offline_store_get_online (store) &&
+               camel_service_get_connection_status (service) == CAMEL_SERVICE_CONNECTED;
 
        /* Returning to online mode is the simpler case. */
        if (!store_is_online) {


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