[evolution-data-server] Add a extended response handler for unhandled imapx tokens to be handled by the derived providers.



commit 374b718710740873db5d9ed326d1d640609ef155
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Tue May 8 14:59:48 2012 +0530

    Add a extended response handler for unhandled imapx tokens to be handled
    by the derived providers.

 camel/camel-imapx-server.c |   13 +++++++++++++
 camel/camel-imapx-server.h |   12 ++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 2d9e598..10d5184 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -1586,6 +1586,10 @@ imapx_untagged (CamelIMAPXServer *is,
 		imapx_free_status (sinfo);
 		return TRUE;
 	default:
+		/* If there is a extended untagged response handler registered, call it */
+		if (is->untagged_handler_func)
+			return is->untagged_handler_func (is, cancellable, error);
+
 		/* unknown response, just ignore it */
 		c(is->tagprefix, "unknown token: %s\n", token);
 	}
@@ -6478,3 +6482,12 @@ camel_imapx_server_get_job_queue_info (CamelIMAPXServer *is)
 
 	return jinfo;
 }
+
+void		
+camel_imapx_server_set_extended_token_handler	(CamelIMAPXServer *is,
+						 IMAPXExtUntaggedResponseHander handler_func)
+{
+	g_return_if_fail (is != NULL);
+
+	is->untagged_handler_func = handler_func;
+}
diff --git a/camel/camel-imapx-server.h b/camel/camel-imapx-server.h
index d442a17..680dfea 100644
--- a/camel/camel-imapx-server.h
+++ b/camel/camel-imapx-server.h
@@ -62,6 +62,11 @@ typedef struct _CamelIMAPXServerClass CamelIMAPXServerClass;
 typedef struct _CamelIMAPXIdle CamelIMAPXIdle;
 struct _IMAPXJobQueueInfo;
 
+typedef gboolean (*IMAPXExtUntaggedResponseHander)
+					(CamelIMAPXServer *server, 
+					 GCancellable *cancellable, 
+					 GError **error);
+
 struct _CamelIMAPXServer {
 	CamelObject parent;
 
@@ -75,6 +80,8 @@ struct _CamelIMAPXServer {
 
 	CamelIMAPXNamespaceList *nsl;
 
+	IMAPXExtUntaggedResponseHander untagged_handler_func;
+
 	/* incoming jobs */
 	GQueue jobs;
 
@@ -234,6 +241,11 @@ struct _IMAPXJobQueueInfo *
 		camel_imapx_server_get_job_queue_info
 						(CamelIMAPXServer *is);
 
+void		camel_imapx_server_set_extended_token_handler 
+						(CamelIMAPXServer *is,
+						 IMAPXExtUntaggedResponseHander handler_func);
+
+
 G_END_DECLS
 
 #endif /* CAMEL_IMAPX_SERVER_H */



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