[evolution-kolab/ek-wip-porting] CamelIMAPXExtdServer: reintegrated ANNOTATEMORE support



commit c395d37c481741058b4a4835207020fbd01341fe
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Thu Mar 8 19:47:35 2012 +0100

    CamelIMAPXExtdServer: reintegrated ANNOTATEMORE support
    
    * reintegrated the handler for ANNOTATION untagged
      responses
    * reintegrated the metadata getter/setter functions
    * made the metadata getter/setter function cancellable

 .../providers/imapx/camel-imapx-extd-server.c      |  286 ++++++++++++++------
 .../providers/imapx/camel-imapx-extd-server.h      |    4 +
 2 files changed, 214 insertions(+), 76 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-extd-server.c b/src/camel/providers/imapx/camel-imapx-extd-server.c
index 455ab99..d2a551e 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-server.c
+++ b/src/camel/providers/imapx/camel-imapx-extd-server.c
@@ -117,6 +117,51 @@ camel_imapx_extd_server_finalize (GObject *object)
 /* internal statics */
 
 static gboolean
+extd_server_untagged_annotation (CamelIMAPXServer *is,
+                                 gboolean *lsub,
+                                 guint id,
+                                 GCancellable *cancellable,
+                                 GError **err)
+{
+	CamelIMAPXExtdServer *self = NULL;
+	CamelIMAPXExtdServerPrivate *priv = NULL;
+	guint32 capa = 0;
+	GError *tmp_err = NULL;
+	gboolean parse_and_add_ok = FALSE;
+
+	(void)lsub;
+	(void)id;
+
+	g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (is));
+	/* cancellable may be NULL */
+	g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
+
+	self = CAMEL_IMAPX_EXTD_SERVER (is);
+	priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
+
+	/* capability check */
+	capa = is->cinfo->capa & IMAPX_ANNOTATEMORE;
+	if (!capa) {
+		g_set_error (err,
+		             CAMEL_IMAPX_ERROR,
+		             1, /* FIXME define and add a sensible code here */
+		             "Got ANNOTATION response but server did not advertise ANNOTATEMORE capability");
+		return FALSE;
+	}
+
+	parse_and_add_ok = camel_imapx_metadata_add_from_server_response (priv->md,
+	                                                                  is->stream,
+	                                                                  cancellable,
+	                                                                  &tmp_err);
+	if (!parse_and_add_ok) {
+		g_propagate_error (err, tmp_err);
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+static gboolean
 extd_server_untagged (CamelIMAPXExtdServer *self,
                       GCancellable *cancellable,
                       GError **error)
@@ -142,7 +187,7 @@ extd_server_untagged (CamelIMAPXExtdServer *self,
 	settings = camel_service_get_settings (service);
 
 	fetch_order = camel_imapx_settings_get_fetch_order (
-		CAMEL_IMAPX_SETTINGS (settings));
+	                                                    CAMEL_IMAPX_SETTINGS (settings));
 
 	e(is->tagprefix, "got untagged response\n");
 	id = 0;
@@ -159,8 +204,8 @@ extd_server_untagged (CamelIMAPXExtdServer *self,
 
 	if (tok == '\n') {
 		g_set_error (
-			error, CAMEL_IMAPX_ERROR, 1,
-			"truncated server response");
+		             error, CAMEL_IMAPX_ERROR, 1,
+		             "truncated server response");
 		return FALSE;
 	}
 
@@ -300,8 +345,8 @@ extd_server_untagged (CamelIMAPXExtdServer *self,
 				data->body_len = camel_stream_write_to_stream (finfo->body, data->stream, job->cancellable, &job->error);
 				if (data->body_len == -1)
 					g_prefix_error (
-						&job->error,
-						_("Error writing to cache stream: "));
+					                &job->error,
+					                _("Error writing to cache stream: "));
 			}
 		}
 
@@ -571,14 +616,21 @@ extd_server_untagged (CamelIMAPXExtdServer *self,
 		}
 		break;
 	}
+	case IMAPX_ANNOTATION:
+		(void)extd_server_untagged_annotation (is,
+		                                       &lsub,
+		                                       id,
+		                                       cancellable,
+		                                       error);
+		break;
 	case IMAPX_BYE: {
 		guchar *token;
 
 		if (camel_imapx_stream_text (is->stream, &token, cancellable, NULL)) {
 			c(is->tagprefix, "BYE: %s\n", token);
 			g_set_error (
-				error, CAMEL_IMAPX_ERROR, 1,
-				"IMAP server said BYE: %s", token);
+			             error, CAMEL_IMAPX_ERROR, 1,
+			             "IMAP server said BYE: %s", token);
 		}
 		is->state = IMAPX_SHUTDOWN;
 		return FALSE;
@@ -685,8 +737,8 @@ extd_server_step (CamelIMAPXExtdServer *self,
 		return camel_imapx_server_continuation (is, FALSE, cancellable, error);
 
 	g_set_error (
-		error, CAMEL_IMAPX_ERROR, 1,
-		"unexpected server response:");
+	             error, CAMEL_IMAPX_ERROR, 1,
+	             "unexpected server response:");
 
 	return FALSE;
 }
@@ -770,17 +822,17 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 
 #ifndef G_OS_WIN32
 	use_shell_command = camel_imapx_settings_get_use_shell_command (
-		CAMEL_IMAPX_SETTINGS (settings));
+	                                                                CAMEL_IMAPX_SETTINGS (settings));
 
 	if (use_shell_command)
 		shell_command = camel_imapx_settings_dup_shell_command (
-			CAMEL_IMAPX_SETTINGS (settings));
+		                                                        CAMEL_IMAPX_SETTINGS (settings));
 
 	if (shell_command != NULL) {
 		gboolean success;
 
 		success = camel_imapx_server_connect_to_server_process (
-			is, shell_command, &local_error);
+		                                                        is, shell_command, &local_error);
 
 		g_free (shell_command);
 
@@ -792,7 +844,7 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 #endif
 
 	tcp_stream = camel_network_service_connect_sync (
-		CAMEL_NETWORK_SERVICE (is->store), cancellable, error);
+	                                                 CAMEL_NETWORK_SERVICE (is->store), cancellable, error);
 
 	if (tcp_stream == NULL) {
 		success = FALSE;
@@ -818,9 +870,9 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 		// poll ?  wait for other stuff? loop?
 		if (camel_application_is_exiting || is->parser_quit) {
 			g_set_error (
-				error, G_IO_ERROR,
-				G_IO_ERROR_CANCELLED,
-				"Connection to server cancelled\n");
+			             error, G_IO_ERROR,
+			             G_IO_ERROR_CANCELLED,
+			             "Connection to server cancelled\n");
 			success = FALSE;
 			goto exit;
 		}
@@ -846,7 +898,7 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 
 	if (!is->cinfo) {
 		ic = camel_imapx_command_new (
-			is, "CAPABILITY", NULL, "CAPABILITY");
+		                              is, "CAPABILITY", NULL, "CAPABILITY");
 		if (!extd_server_command_run (self, ic, cancellable, error)) {
 			camel_imapx_command_unref (ic);
 			success = FALSE;
@@ -856,9 +908,9 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 		/* Server reported error. */
 		if (ic->status->result != IMAPX_OK) {
 			g_set_error (
-				error, CAMEL_ERROR,
-				CAMEL_ERROR_GENERIC,
-				"%s", ic->status->text);
+			             error, CAMEL_ERROR,
+			             CAMEL_ERROR_GENERIC,
+			             "%s", ic->status->text);
 			camel_imapx_command_unref (ic);
 			success = FALSE;
 			goto exit;
@@ -871,15 +923,15 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 
 		if (!(is->cinfo->capa & IMAPX_CAPABILITY_STARTTLS)) {
 			g_set_error (
-				&local_error, CAMEL_ERROR,
-				CAMEL_ERROR_GENERIC,
-				_("Failed to connect to IMAP server %s in secure mode: %s"),
-				host, _("STARTTLS not supported"));
+			             &local_error, CAMEL_ERROR,
+			             CAMEL_ERROR_GENERIC,
+			             _("Failed to connect to IMAP server %s in secure mode: %s"),
+			             host, _("STARTTLS not supported"));
 			goto exit;
 		}
 
 		ic = camel_imapx_command_new (
-			is, "STARTTLS", NULL, "STARTTLS");
+		                              is, "STARTTLS", NULL, "STARTTLS");
 		if (!extd_server_command_run (self, ic, cancellable, error)) {
 			camel_imapx_command_unref (ic);
 			success = FALSE;
@@ -889,9 +941,9 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 		/* Server reported error. */
 		if (ic->status->result != IMAPX_OK) {
 			g_set_error (
-				error, CAMEL_ERROR,
-				CAMEL_ERROR_GENERIC,
-				"%s", ic->status->text);
+			             error, CAMEL_ERROR,
+			             CAMEL_ERROR_GENERIC,
+			             "%s", ic->status->text);
 			camel_imapx_command_unref (ic);
 			success = FALSE;
 			goto exit;
@@ -909,18 +961,18 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 		camel_imapx_command_unref (ic);
 
 		if (camel_tcp_stream_ssl_enable_ssl (
-			CAMEL_TCP_STREAM_SSL (tcp_stream),
-			cancellable, &local_error) == -1) {
+		                                     CAMEL_TCP_STREAM_SSL (tcp_stream),
+		                                     cancellable, &local_error) == -1) {
 			g_prefix_error (
-				&local_error,
-				_("Failed to connect to IMAP server %s in secure mode: "),
-				host);
+			                &local_error,
+			                _("Failed to connect to IMAP server %s in secure mode: "),
+			                host);
 			goto exit;
 		}
 		/* Get new capabilities if they weren't already given */
 		if (!is->cinfo) {
 			ic = camel_imapx_command_new (
-				is, "CAPABILITY", NULL, "CAPABILITY");
+			                              is, "CAPABILITY", NULL, "CAPABILITY");
 			if (!extd_server_command_run (self, ic, cancellable, error)) {
 				camel_imapx_command_unref (ic);
 				success = FALSE;
@@ -931,7 +983,7 @@ extd_server_connect_to_server (CamelIMAPXExtdServer *self,
 		}
 	}
 
-exit:
+ exit:
 	if (!success) {
 		if (is->stream != NULL) {
 			g_object_unref (is->stream);
@@ -975,13 +1027,13 @@ extd_server_reconnect (CamelIMAPXExtdServer *self,
 	settings = camel_service_get_settings (service);
 
 	mechanism = camel_network_settings_dup_auth_mechanism (
-		CAMEL_NETWORK_SETTINGS (settings));
+	                                                       CAMEL_NETWORK_SETTINGS (settings));
 
 	use_idle = camel_imapx_settings_get_use_idle (
-		CAMEL_IMAPX_SETTINGS (settings));
+	                                              CAMEL_IMAPX_SETTINGS (settings));
 
 	use_qresync = camel_imapx_settings_get_use_qresync (
-		CAMEL_IMAPX_SETTINGS (settings));
+	                                                    CAMEL_IMAPX_SETTINGS (settings));
 
 	if (!extd_server_connect_to_server (self, cancellable, error))
 		goto exception;
@@ -990,13 +1042,13 @@ extd_server_reconnect (CamelIMAPXExtdServer *self,
 		goto preauthed;
 
 	if (!camel_session_authenticate_sync (
-		session, service, mechanism, cancellable, error))
+	                                      session, service, mechanism, cancellable, error))
 		goto exception;
 
 	/* After login we re-capa unless the server already told us */
 	if (!is->cinfo) {
 		ic = camel_imapx_command_new (
-			is, "CAPABILITY", NULL, "CAPABILITY");
+		                              is, "CAPABILITY", NULL, "CAPABILITY");
 		if (!extd_server_command_run (self, ic, cancellable, error)) {
 			camel_imapx_command_unref (ic);
 			goto exception;
@@ -1016,7 +1068,7 @@ extd_server_reconnect (CamelIMAPXExtdServer *self,
 	/* Fetch namespaces */
 	if (is->cinfo->capa & IMAPX_CAPABILITY_NAMESPACE) {
 		ic = camel_imapx_command_new (
-			is, "NAMESPACE", NULL, "NAMESPACE");
+		                              is, "NAMESPACE", NULL, "NAMESPACE");
 		if (!extd_server_command_run (self, ic, cancellable, error)) {
 			camel_imapx_command_unref (ic);
 			goto exception;
@@ -1027,7 +1079,7 @@ extd_server_reconnect (CamelIMAPXExtdServer *self,
 
 	if (use_qresync && is->cinfo->capa & IMAPX_CAPABILITY_QRESYNC) {
 		ic = camel_imapx_command_new (
-			is, "ENABLE", NULL, "ENABLE CONDSTORE QRESYNC");
+		                              is, "ENABLE", NULL, "ENABLE CONDSTORE QRESYNC");
 		if (!extd_server_command_run (self, ic, cancellable, error)) {
 			camel_imapx_command_unref (ic);
 			goto exception;
@@ -1063,7 +1115,7 @@ extd_server_reconnect (CamelIMAPXExtdServer *self,
 
 	return TRUE;
 
-exception:
+ exception:
 
 	camel_imapx_server_disconnect (is);
 
@@ -1141,9 +1193,9 @@ extd_server_parser_thread (gpointer d)
 			g_cancellable_release_fd (cancellable);
 		} else
 #endif
-		{
-			extd_server_parse_contents (self, cancellable, &local_error);
-		}
+			{
+				extd_server_parse_contents (self, cancellable, &local_error);
+			}
 
 		if (is->parser_quit)
 			g_cancellable_cancel (cancellable);
@@ -1260,8 +1312,8 @@ imapx_extd_server_authenticate (CamelIMAPXServer *self,
 	gchar *user = NULL;
 
 	g_return_val_if_fail (
-		CAMEL_IS_IMAPX_EXTD_SERVER (self),
-		CAMEL_AUTHENTICATION_REJECTED);
+	                      CAMEL_IS_IMAPX_EXTD_SERVER (self),
+	                      CAMEL_AUTHENTICATION_REJECTED);
 	/* mechanism may be NULL */
 	/* cancellable may be NULL */
 	g_return_val_if_fail (error == NULL || *error == NULL, CAMEL_AUTHENTICATION_REJECTED);
@@ -1277,10 +1329,10 @@ imapx_extd_server_authenticate (CamelIMAPXServer *self,
 	if (mechanism != NULL) {
 		if (!g_hash_table_lookup (is->cinfo->auth_types, mechanism)) {
 			g_set_error (
-				error, CAMEL_SERVICE_ERROR,
-				CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
-				_("IMAP server %s does not support %s "
-				  "authentication"), host, mechanism);
+			             error, CAMEL_SERVICE_ERROR,
+			             CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+			             _("IMAP server %s does not support %s "
+			               "authentication"), host, mechanism);
 			result = CAMEL_AUTHENTICATION_ERROR;
 			goto exit;
 		}
@@ -1288,10 +1340,10 @@ imapx_extd_server_authenticate (CamelIMAPXServer *self,
 		sasl = camel_sasl_new ("imap", mechanism, service);
 		if (sasl == NULL) {
 			g_set_error (
-				error, CAMEL_SERVICE_ERROR,
-				CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
-				_("No support for %s authentication"),
-				mechanism);
+			             error, CAMEL_SERVICE_ERROR,
+			             CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+			             _("No support for %s authentication"),
+			             mechanism);
 			result = CAMEL_AUTHENTICATION_ERROR;
 			goto exit;
 		}
@@ -1299,7 +1351,7 @@ imapx_extd_server_authenticate (CamelIMAPXServer *self,
 
 	if (sasl != NULL) {
 		ic = camel_imapx_command_new (
-			is, "AUTHENTICATE", NULL, "AUTHENTICATE %A", sasl);
+		                              is, "AUTHENTICATE", NULL, "AUTHENTICATE %A", sasl);
 	} else {
 		const gchar *password;
 
@@ -1307,24 +1359,24 @@ imapx_extd_server_authenticate (CamelIMAPXServer *self,
 
 		if (user == NULL) {
 			g_set_error_literal (
-				error, CAMEL_SERVICE_ERROR,
-				CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
-				_("Cannot authenticate without a username"));
+			                     error, CAMEL_SERVICE_ERROR,
+			                     CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+			                     _("Cannot authenticate without a username"));
 			result = CAMEL_AUTHENTICATION_ERROR;
 			goto exit;
 		}
 
 		if (password == NULL) {
 			g_set_error_literal (
-				error, CAMEL_SERVICE_ERROR,
-				CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
-				_("Authentication password not available"));
+			                     error, CAMEL_SERVICE_ERROR,
+			                     CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
+			                     _("Authentication password not available"));
 			result = CAMEL_AUTHENTICATION_ERROR;
 			goto exit;
 		}
 
 		ic = camel_imapx_command_new (
-			is, "LOGIN", NULL, "LOGIN %s %s", user, password);
+		                              is, "LOGIN", NULL, "LOGIN %s %s", user, password);
 	}
 
 	if (!extd_server_command_run (CAMEL_IMAPX_EXTD_SERVER (self), ic, cancellable, error))
@@ -1353,7 +1405,7 @@ imapx_extd_server_authenticate (CamelIMAPXServer *self,
 	if (sasl != NULL)
 		g_object_unref (sasl);
 
-exit:
+ exit:
 	g_free (host);
 	g_free (user);
 
@@ -1693,40 +1745,119 @@ static CamelImapxMetadata*
 imapx_extd_server_get_metadata (CamelIMAPXExtdServer *self,
                                 CamelImapxMetadataSpec *spec,
                                 gboolean do_resect,
+                                GCancellable *cancellable,
                                 GError **err)
 {
 	CamelIMAPXExtdServerPrivate *priv = NULL;
+	CamelIMAPXServer *is = NULL;
+	CamelIMAPXCommand *ic = NULL;
+	CamelImapxMetadata *md = NULL;
+	gchar *cmd = NULL;
+	GError *tmp_err = NULL;
 
 	g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (self));
 	g_assert (spec != NULL);
-	(void)do_resect; /* FIXME */
+	/* cancellable may be NULL */
 	g_return_val_if_fail (err == NULL || *err == NULL, NULL);
 
 	priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
+	is = CAMEL_IMAPX_SERVER (self);
 
-	/* FIXME implement me */
-	g_error ("%s: FIXME: implement me", __func__);
+	/* TODO move GETANNOTATION string to -metadata.[hc]
+	 *      (add a function to return proper string depending
+	 *      on protocol type)
+	 */
+	cmd = g_strdup_printf ("GETANNOTATION \"%s\" \"%s\" \"%s\"",
+	                       spec->mailbox_name,
+	                       spec->entry_name,
+	                       spec->attrib_name);
+	ic = camel_imapx_command_new (is,
+	                              "GETANNOTATION",
+	                              NULL,
+	                              cmd);
+
+	/* run GETANNOTATION command synchronously
+	 * (TODO can we change this to async operation?)
+	 *
+	 * FIXME: do we need to use extd_server_command_run()
+	 *        instead?
+	 */
+	camel_imapx_server_command_run_sync (is, ic, cancellable, &tmp_err);
+
+	g_free (cmd);
+	camel_imapx_command_unref (ic);
 
-	return NULL;
+	if (tmp_err != NULL) {
+		g_propagate_error (err, tmp_err);
+		return NULL;
+	}
+
+	/* only if do_resect==TRUE we do return the metadata,
+	 * otherwise we only get it from the server and leave
+	 * the result inside this object for later resection
+	 */
+	if (do_resect)
+		md = camel_imapx_metadata_resect (&(priv->md));
+
+	return md;
 }
 
 static gboolean
 imapx_extd_server_set_metadata (CamelIMAPXExtdServer *self,
                                 CamelImapxMetadata *md,
+                                GCancellable *cancellable,
                                 GError **err)
 {
-	CamelIMAPXExtdServerPrivate *priv = NULL;
+	CamelIMAPXServer *is = NULL;
+	CamelIMAPXCommand *ic = NULL;
+	GSList *commands = NULL;
+	GSList *cur_cmd = NULL;
+	GError *tmp_err = NULL;
 
 	g_assert (CAMEL_IS_IMAPX_EXTD_SERVER (self));
 	g_assert (md != NULL);
 	g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
 
-	priv = CAMEL_IMAPX_EXTD_SERVER_PRIVATE (self);
+	is = CAMEL_IMAPX_SERVER (self);
 
-	/* FIXME implement me */
-	g_error ("%s: FIXME: implement me", __func__);
+	commands = camel_imapx_metadata_new_commandlist (md);
 
-	return FALSE;
+	if (commands == NULL)
+		return TRUE;
+
+	cur_cmd = commands;
+	while (cur_cmd != NULL) {
+		/* TODO move SETANNOTATION string to -metadata.[hc]
+		 *      (add a function to return proper string depending
+		 *      on protocol type)
+		 */
+		ic = camel_imapx_command_new (is,
+				              "SETANNOTATION",
+				              NULL,
+				              (gchar *) cur_cmd->data);
+
+		/* run SETANNOTATION command synchronously
+		 * (TODO can we change this to async operation?)
+		 *
+		 * FIXME: do we need to use extd_server_command_run()
+		 *        instead?
+		 */
+		camel_imapx_server_command_run_sync (is, ic, cancellable, &tmp_err);
+
+		camel_imapx_command_unref (ic);
+
+		if (tmp_err != NULL) {
+			g_slist_free (commands);
+			g_propagate_error (err, tmp_err);
+			return FALSE;
+		}
+
+		cur_cmd = g_slist_next (cur_cmd);
+	}
+
+	g_slist_free (commands);
+
+	return TRUE;
 }
 
 /*----------------------------------------------------------------------------*/
@@ -1788,7 +1919,7 @@ camel_imapx_extd_server_new (CamelIMAPXExtdStore *store)
 	is = CAMEL_IMAPX_SERVER (self);
 
 	is->session = g_object_ref (session);
-	is->store = store;
+	is->store = CAMEL_STORE (store);
 
 	return self;
 }
@@ -2148,6 +2279,7 @@ CamelImapxMetadata*
 camel_imapx_extd_server_get_metadata (CamelIMAPXExtdServer *self,
                                       CamelImapxMetadataSpec *spec,
                                       gboolean do_resect,
+                                      GCancellable *cancellable,
                                       GError **err)
 {
 	CamelIMAPXExtdServerClass *klass = NULL;
@@ -2159,6 +2291,7 @@ camel_imapx_extd_server_get_metadata (CamelIMAPXExtdServer *self,
 	md = klass->get_metadata (self,
 	                          spec,
 	                          do_resect,
+	                          cancellable,
 	                          err);
 	return md;
 }
@@ -2166,6 +2299,7 @@ camel_imapx_extd_server_get_metadata (CamelIMAPXExtdServer *self,
 gboolean
 camel_imapx_extd_server_set_metadata (CamelIMAPXExtdServer *self,
                                       CamelImapxMetadata *md,
+                                      GCancellable *cancellable,
                                       GError **err)
 {
 	CamelIMAPXExtdServerClass *klass = NULL;
@@ -2174,7 +2308,7 @@ camel_imapx_extd_server_set_metadata (CamelIMAPXExtdServer *self,
 	g_return_val_if_fail (CAMEL_IS_IMAPX_EXTD_SERVER (self), FALSE);
 
 	klass = CAMEL_IMAPX_EXTD_SERVER_GET_CLASS (self);
-	ok = klass->set_metadata (self, md, err);
+	ok = klass->set_metadata (self, md, cancellable, err);
 
 	return ok;
 }
diff --git a/src/camel/providers/imapx/camel-imapx-extd-server.h b/src/camel/providers/imapx/camel-imapx-extd-server.h
index 753c38e..da6c3bf 100644
--- a/src/camel/providers/imapx/camel-imapx-extd-server.h
+++ b/src/camel/providers/imapx/camel-imapx-extd-server.h
@@ -170,10 +170,12 @@ struct _CamelIMAPXExtdServerClass {
 	CamelImapxMetadata* (*get_metadata) (CamelIMAPXExtdServer *self,
 	                                     CamelImapxMetadataSpec *spec,
 	                                     gboolean do_resect,
+	                                     GCancellable *cancellable,
 	                                     GError **err);
 
 	gboolean (*set_metadata) (CamelIMAPXExtdServer *self,
 	                          CamelImapxMetadata *md,
+	                          GCancellable *cancellable,
 	                          GError **err);
 };
 
@@ -296,11 +298,13 @@ CamelImapxMetadata*
 camel_imapx_extd_server_get_metadata (CamelIMAPXExtdServer *self,
                                       CamelImapxMetadataSpec *spec,
                                       gboolean do_resect,
+                                      GCancellable *cancellable,
                                       GError **err);
 
 gboolean
 camel_imapx_extd_server_set_metadata (CamelIMAPXExtdServer *self,
                                       CamelImapxMetadata *md,
+                                      GCancellable *cancellable,
                                       GError **err);
 
 G_END_DECLS



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