[evolution-kolab/EDS_IMAPX_nobuild] updated IMAPX files as of EDS commit b9ad01ba73afb402f194c2f66a90432e47003091



commit 037cfd605a42001fda6e0835cb0228dc6b086e5a
Author: Christian Hilberg <hilberg kernelconcepts de>
Date:   Tue Feb 14 12:39:54 2012 +0100

    updated IMAPX files as of EDS commit b9ad01ba73afb402f194c2f66a90432e47003091
    
    * updated the local IMAPX code from upstream
    * now at EDS commit
      b9ad01ba73afb402f194c2f66a90432e47003091

 src/camel/providers/imapx/camel-imapx-server.c     |   59 ++++++++++----------
 .../providers/imapx/camel-imapx-store-summary.c    |    2 +-
 src/camel/providers/imapx/camel-imapx-utils.c      |   10 +--
 3 files changed, 34 insertions(+), 37 deletions(-)
---
diff --git a/src/camel/providers/imapx/camel-imapx-server.c b/src/camel/providers/imapx/camel-imapx-server.c
index 353aa0b..7c38064 100644
--- a/src/camel/providers/imapx/camel-imapx-server.c
+++ b/src/camel/providers/imapx/camel-imapx-server.c
@@ -415,11 +415,11 @@ imapx_uidset_init (struct _uidset_state *ss,
 	ss->limit = limit;
 }
 
-gint
+gboolean
 imapx_uidset_done (struct _uidset_state *ss,
                    CamelIMAPXCommand *ic)
 {
-	gint ret = 0;
+	gint ret = FALSE;
 
 	if (ss->last != 0 && ss->last != ss->start) {
 		camel_imapx_command_add (ic, ":%d", ss->last);
@@ -475,7 +475,8 @@ imapx_uidset_add (struct _uidset_state *ss,
 	if ((ss->limit && ss->entries >= ss->limit)
 	    || (ss->total && ss->uids >= ss->total)) {
 		e(ic->is->tagprefix, " done, %d entries, %d uids\n", ss->entries, ss->uids);
-		imapx_uidset_done (ss, ic);
+		if (!imapx_uidset_done (ss, ic))
+			return -1;
 		return 1;
 	}
 
@@ -2317,16 +2318,14 @@ imapx_command_select_done (CamelIMAPXServer *is,
 	if (camel_imapx_command_set_error_if_failed (ic, &local_error)) {
 		GQueue failed = G_QUEUE_INIT;
 		GQueue trash = G_QUEUE_INIT;
-		GList *head, *link;
+		GList *link;
 
 		c(is->tagprefix, "Select failed\n");
 
 		QUEUE_LOCK (is);
 
-		head = camel_imapx_command_queue_peek_head_link (is->queue);
-
 		if (is->select_pending) {
-			head = camel_imapx_command_queue_peek_head_link (is->queue);
+			GList *head = camel_imapx_command_queue_peek_head_link (is->queue);
 
 			for (link = head; link != NULL; link = g_list_next (link)) {
 				CamelIMAPXCommand *cw = link->data;
@@ -2940,7 +2939,7 @@ camel_imapx_server_authenticate (CamelIMAPXServer *is,
 		}
 
 		sasl = camel_sasl_new ("imap", mechanism, service);
-		if (sasl != NULL) {
+		if (sasl == NULL) {
 			g_set_error (
 				error, CAMEL_SERVICE_ERROR,
 				CAMEL_SERVICE_ERROR_CANT_AUTHENTICATE,
@@ -4169,12 +4168,11 @@ imapx_job_fetch_messages_start (CamelIMAPXJob *job,
 
 			imapx_command_run_sync (is, ic, job->cancellable, &job->error);
 
-			if (ic->job->error == NULL)
-                                camel_imapx_command_set_error_if_failed (ic, &ic->job->error);
-
-                        g_prefix_error (
-                                &ic->job->error, "%s: ",
-                                _("Error while fetching messages"));
+			if (ic->job->error != NULL || camel_imapx_command_set_error_if_failed (ic, &ic->job->error)) {
+				g_prefix_error (
+					&ic->job->error, "%s: ",
+					_("Error while fetching messages"));
+			}
 
 			camel_imapx_command_unref (ic);
 		}
@@ -4293,6 +4291,7 @@ imapx_job_refresh_info_start (CamelIMAPXJob *job,
 	if (!need_rescan) {
 		CamelIMAPXCommand *ic;
 
+		#if 0
 		if (is_selected) {
 			/* We may not issue STATUS on the current folder. Use SELECT or NOOP instead. */
 			if (0 /* server needs SELECT not just NOOP */) {
@@ -4311,7 +4310,9 @@ imapx_job_refresh_info_start (CamelIMAPXJob *job,
 						goto done;
 				}
 			}
-		} else {
+		} else
+		#endif
+		{
 			if (is->cinfo->capa & IMAPX_CAPABILITY_CONDSTORE)
 				ic = camel_imapx_command_new (
 					is, "STATUS", NULL,
@@ -4327,12 +4328,11 @@ imapx_job_refresh_info_start (CamelIMAPXJob *job,
 			imapx_command_run_sync (
 				is, ic, job->cancellable, &job->error);
 
-			if (ic->job->error == NULL)
-				camel_imapx_command_set_error_if_failed (ic, &ic->job->error);
-
-			g_prefix_error (
-				&ic->job->error, "%s: ",
-				_("Error refreshing folder"));
+			if (ic->job->error != NULL || camel_imapx_command_set_error_if_failed (ic, &ic->job->error)) {
+				g_prefix_error (
+					&ic->job->error, "%s: ",
+					_("Error refreshing folder"));
+			}
 
 			if (ic->job->error != NULL) {
 				camel_imapx_command_unref (ic);
@@ -4362,13 +4362,12 @@ imapx_job_refresh_info_start (CamelIMAPXJob *job,
 
 		imapx_command_run_sync (is, ic, job->cancellable, &job->error);
 
-		if (ic->job->error == NULL)
-			camel_imapx_command_set_error_if_failed (ic, &ic->job->error);
+		if (ic->job->error != NULL || camel_imapx_command_set_error_if_failed (ic, &ic->job->error)) {
+			g_prefix_error (
+				&ic->job->error, "%s: ",
+				_("Error refreshing folder"));
+		}
 
-		g_prefix_error (
-			&ic->job->error, "%s: ",
-			_("Error refreshing folder"));
-		
 		if (ic->job->error != NULL) {
 			camel_imapx_command_unref (ic);
 			goto done;
@@ -5019,7 +5018,7 @@ imapx_job_sync_changes_start (CamelIMAPXJob *job,
 					}
 					send = imapx_uidset_add (&ss, ic, camel_message_info_uid (info));
 				}
-				if (send || (i == uids->len - 1 && imapx_uidset_done (&ss, ic))) {
+				if (send == 1 || (i == uids->len - 1 && imapx_uidset_done (&ss, ic))) {
 					job->commands++;
 					camel_imapx_command_add (ic, " %tFLAGS.SILENT (%t)", on?"+":"-", flags_table[j].name);
 					imapx_command_queue (is, ic);
@@ -5056,7 +5055,7 @@ imapx_job_sync_changes_start (CamelIMAPXJob *job,
 						ic->pri = job->pri;
 					}
 
-					if (imapx_uidset_add (&ss, ic, camel_message_info_uid (info))
+					if (imapx_uidset_add (&ss, ic, camel_message_info_uid (info)) == 1
 					    || (i == c->infos->len - 1 && imapx_uidset_done (&ss, ic))) {
 						job->commands++;
 						camel_imapx_command_add (ic, " %tFLAGS.SILENT (%t)", on?"+":"-", c->name);
@@ -5881,7 +5880,7 @@ imapx_server_sync_changes (CamelIMAPXServer *is,
 			if (uflags) {
 				if (suflags)
 					res = strcmp (uflags->name, suflags->name);
-				else if (uflags->name && *uflags->name)
+				else if (*uflags->name)
 					res = -1;
 				else {
 					uflags = uflags->next;
diff --git a/src/camel/providers/imapx/camel-imapx-store-summary.c b/src/camel/providers/imapx/camel-imapx-store-summary.c
index c764106..8a8142e 100644
--- a/src/camel/providers/imapx/camel-imapx-store-summary.c
+++ b/src/camel/providers/imapx/camel-imapx-store-summary.c
@@ -666,5 +666,5 @@ camel_imapx_store_summary_set_namespaces (CamelIMAPXStoreSummary *summary,
 {
 	if (summary->namespaces)
 		camel_imapx_namespace_list_clear (summary->namespaces);
-	summary->namespaces = camel_imapx_namespace_list_copy (summary->namespaces);
+	summary->namespaces = camel_imapx_namespace_list_copy (nsl);
 }
diff --git a/src/camel/providers/imapx/camel-imapx-utils.c b/src/camel/providers/imapx/camel-imapx-utils.c
index a7a0825..776f615 100644
--- a/src/camel/providers/imapx/camel-imapx-utils.c
+++ b/src/camel/providers/imapx/camel-imapx-utils.c
@@ -885,9 +885,8 @@ imapx_parse_address_list (CamelIMAPXStream *is,
 
 	tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
 	if (tok == '(') {
+		struct _camel_header_address *addr, *group = NULL;
 		while (1) {
-			struct _camel_header_address *addr, *group = NULL;
-
 			/* address         ::= "(" addr_name SPACE addr_adl SPACE addr_mailbox
 			 * SPACE addr_host ")" */
 			tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
@@ -930,7 +929,7 @@ imapx_parse_address_list (CamelIMAPXStream *is,
 					group = addr;
 				}
 			} else {
-				addr->v.addr = g_strdup_printf("%s%s%s", mbox? mbox:"", host?"@":"", host?(gchar *)host:"");
+				addr->v.addr = g_strdup_printf ("%s %s", mbox? mbox :"", (const gchar *) host);
 				g_free (mbox);
 				d(is->tagprefix, "adding address '%s'\n", addr->v.addr);
 				if (group != NULL)
@@ -1082,7 +1081,6 @@ imapx_parse_body (CamelIMAPXStream *is,
 	struct _CamelMessageContentInfo * cinfo = NULL;
 	struct _CamelMessageContentInfo *subinfo, *last;
 	struct _CamelContentDisposition * dinfo = NULL;
-	struct _CamelMessageInfo * minfo = NULL;
 	GError *local_error = NULL;
 
 	/* body            ::= "(" body_type_1part / body_type_mpart ")" */
@@ -1161,6 +1159,8 @@ imapx_parse_body (CamelIMAPXStream *is,
 		tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
 		camel_imapx_stream_ungettoken (is, tok, token, len);
 		if (tok == '(') {
+			struct _CamelMessageInfo * minfo = NULL;
+
 			/* what do we do with the envelope?? */
 			minfo = imapx_parse_envelope (is, cancellable, &local_error);
 			/* what do we do with the message content info?? */
@@ -1220,8 +1220,6 @@ imapx_parse_body (CamelIMAPXStream *is,
 			imapx_free_body (cinfo);
 		if (dinfo)
 			camel_content_disposition_unref (dinfo);
-		if (minfo)
-			camel_message_info_free (minfo);
 		return NULL;
 	}
 



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