aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-08-21 05:44:29 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-08-21 05:44:29 +0800
commit164f4653dd98cd41fc7e3dd64b09145dec04bed8 (patch)
tree04d58b72775bf962314eb9a98870408407f6f48e /camel/providers
parent07c805c9f58f4b025960ea5718f4e1448bf9c4cc (diff)
downloadgsoc2013-evolution-164f4653dd98cd41fc7e3dd64b09145dec04bed8.tar.gz
gsoc2013-evolution-164f4653dd98cd41fc7e3dd64b09145dec04bed8.tar.zst
gsoc2013-evolution-164f4653dd98cd41fc7e3dd64b09145dec04bed8.zip
Override the default noop implementation.
2002-08-20 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-store.c (imap_noop): Override the default noop implementation. * camel-store.c (camel_store_noop): New virtual method to ping a store. * camel-session.c (get_service): Register a timeout that calls camel_store_noop() every 10 minutes. svn path=/trunk/; revision=17822
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-store.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index f54b129e27..9950849539 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -86,6 +86,7 @@ static gboolean imap_connect_online (CamelService *service, CamelException *ex);
static gboolean imap_connect_offline (CamelService *service, CamelException *ex);
static gboolean imap_disconnect_online (CamelService *service, gboolean clean, CamelException *ex);
static gboolean imap_disconnect_offline (CamelService *service, gboolean clean, CamelException *ex);
+static void imap_noop (CamelStore *store, CamelException *ex);
static GList *query_auth_types (CamelService *service, CamelException *ex);
static guint hash_folder_name (gconstpointer key);
static gint compare_folder_name (gconstpointer a, gconstpointer b);
@@ -108,7 +109,6 @@ static void subscribe_folder (CamelStore *store, const char *folder_name,
static void unsubscribe_folder (CamelStore *store, const char *folder_name,
CamelException *ex);
-
static void get_folders_online (CamelImapStore *imap_store, const char *pattern,
GPtrArray *folders, gboolean lsub, CamelException *ex);
@@ -153,6 +153,7 @@ camel_imap_store_class_init (CamelImapStoreClass *camel_imap_store_class)
camel_store_class->folder_subscribed = folder_subscribed;
camel_store_class->subscribe_folder = subscribe_folder;
camel_store_class->unsubscribe_folder = unsubscribe_folder;
+ camel_store_class->noop = imap_noop;
camel_disco_store_class->can_work_offline = can_work_offline;
camel_disco_store_class->connect_online = imap_connect_online;
@@ -1404,6 +1405,25 @@ imap_disconnect_online (CamelService *service, gboolean clean, CamelException *e
return TRUE;
}
+static void
+imap_noop (CamelStore *store, CamelException *ex)
+{
+ CamelImapStore *imap_store = (CamelImapStore *) store;
+ CamelDiscoStore *disco = (CamelDiscoStore *) store;
+ CamelImapResponse *response;
+
+ switch (camel_disco_store_status (disco)) {
+ case CAMEL_DISCO_STORE_ONLINE:
+ case CAMEL_DISCO_STORE_RESYNCING:
+ response = camel_imap_command (imap_store, NULL, NULL, "NOOP");
+ if (response)
+ camel_imap_response_free (imap_store, response);
+ break;
+ case CAMEL_DISCO_STORE_OFFLINE:
+ break;
+ }
+}
+
static guint
hash_folder_name (gconstpointer key)
{