diff options
author | Milan Crha <mcrha@redhat.com> | 2019-06-27 18:59:03 +0200 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2019-06-27 18:59:03 +0200 |
commit | 38452d90595d1bd731b074eeaca3c363e16c30d8 (patch) | |
tree | 6942746fd8ddcbdac83ba29624df7b83a4db1c80 | |
parent | d73d74bc4ce58d71f7bb4fa494ad695931638f6e (diff) | |
download | evolution-data-server-38452d90595d1bd731b074eeaca3c363e16c30d8.tar.gz |
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
-rw-r--r-- | src/camel/camel-offline-store.c | 14 |
1 files 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) { |