commit 8a640246852733904892a4f54c4894d71c1ec33f
Author: Chenthill Palanisamy <pchenthill@novell.com>
Date:   Tue Apr 17 21:55:03 2012 +0530

    Add a extended untagged response handler for the subclasses to hook into

diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 34eddde..bd4d9e6 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -1584,6 +1584,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);
 	}
@@ -6471,3 +6475,13 @@ 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/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
index 0172228..2970e82 100644
--- a/camel/providers/imapx/camel-imapx-server.h
+++ b/camel/providers/imapx/camel-imapx-server.h
@@ -56,6 +56,10 @@ typedef struct _CamelIMAPXServerClass CamelIMAPXServerClass;
 typedef struct _CamelIMAPXIdle CamelIMAPXIdle;
 struct _IMAPXJobQueueInfo;
 
+typedef gboolean (*IMAPXExtUntaggedResponseHander)
+						(CamelIMAPXServer *server, 
+						 GCancellable *cancellable, 
+						 GError **error);
 struct _CamelIMAPXServer {
 	CamelObject parent;
 
@@ -69,6 +73,8 @@ struct _CamelIMAPXServer {
 
 	CamelIMAPXNamespaceList *nsl;
 
+	IMAPXExtUntaggedResponseHander untagged_handler_func;
+
 	/* incoming jobs */
 	GQueue jobs;
 
@@ -134,6 +140,7 @@ struct _CamelIMAPXServerClass {
 	gchar tagprefix;
 };
 
+
 GType		camel_imapx_server_get_type	(void);
 CamelIMAPXServer *
 		camel_imapx_server_new		(CamelStore *store);
@@ -227,6 +234,10 @@ 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 */
