[evolution-data-server] Bug 734300 - [IMAPx] Process untagged EXPUNGE response only once



commit f81346063cff75d429c06dc4bbeed298673bf6bf
Author: Milan Crha <mcrha redhat com>
Date:   Wed May 20 17:23:24 2015 +0200

    Bug 734300 - [IMAPx] Process untagged EXPUNGE response only once

 camel/providers/imapx/camel-imapx-server.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index bc02031..533f52f 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -1958,6 +1958,13 @@ imapx_untagged_expunge (CamelIMAPXServer *is,
        if (job != NULL)
                return TRUE;
 
+       job = imapx_match_active_job (is, IMAPX_JOB_COPY_MESSAGE, NULL);
+       /* Ignore EXPUNGE responses when not running a COPY(MOVE)_MESSAGE job */
+       if (!job) {
+               c (is->tagprefix, "ignoring untagged expunge: %lu\n", is->priv->context->id);
+               return TRUE;
+       }
+
        c (is->tagprefix, "expunged: %lu\n", is->priv->context->id);
 
        g_mutex_lock (&is->priv->select_lock);
@@ -5586,6 +5593,14 @@ imapx_job_copy_messages_start (CamelIMAPXJob *job,
        return imapx_command_copy_messages_step_start (is, job, 0, error);
 }
 
+static gboolean
+imapx_job_copy_messages_matches (CamelIMAPXJob *job,
+                                CamelIMAPXMailbox *mailbox,
+                                const gchar *uid)
+{
+       return camel_imapx_job_has_mailbox (job, mailbox);
+}
+
 /* ********************************************************************** */
 
 static void
@@ -8632,6 +8647,7 @@ camel_imapx_server_copy_message (CamelIMAPXServer *is,
        job->pri = IMAPX_PRIORITY_COPY_MESSAGE;
        job->type = IMAPX_JOB_COPY_MESSAGE;
        job->start = imapx_job_copy_messages_start;
+       job->matches = imapx_job_copy_messages_matches;
 
        camel_imapx_job_set_mailbox (job, mailbox);
 


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