[evolution-data-server] IMAPX: duplicate_fetch_or_refresh() cleanups.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] IMAPX: duplicate_fetch_or_refresh() cleanups.
- Date: Thu, 15 Aug 2013 09:47:53 +0000 (UTC)
commit 787dc867820e055c09be6c74e5da51a4de11bfa4
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Aug 14 08:30:07 2013 -0400
IMAPX: duplicate_fetch_or_refresh() cleanups.
camel/camel-imapx-server.c | 27 +++++++++++++++++----------
1 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 69c15fa..4e01729 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -909,25 +909,32 @@ exit:
}
static gboolean
-duplicate_fetch_or_refresh (CamelIMAPXServer *is,
- CamelIMAPXCommand *ic)
+imapx_is_duplicate_fetch_or_refresh (CamelIMAPXServer *is,
+ CamelIMAPXCommand *ic)
{
CamelIMAPXJob *job;
+ guint32 job_types;
+
+ /* Job types to match. */
+ job_types =
+ IMAPX_JOB_FETCH_NEW_MESSAGES |
+ IMAPX_JOB_REFRESH_INFO |
+ IMAPX_JOB_FETCH_MESSAGES;
job = camel_imapx_command_get_job (ic);
if (job == NULL)
return FALSE;
- if (!(job->type & (IMAPX_JOB_FETCH_NEW_MESSAGES | IMAPX_JOB_REFRESH_INFO | IMAPX_JOB_FETCH_MESSAGES)))
+ if ((job->type && job_types) == 0)
return FALSE;
- if (imapx_match_active_job (is, IMAPX_JOB_FETCH_NEW_MESSAGES | IMAPX_JOB_REFRESH_INFO |
IMAPX_JOB_FETCH_MESSAGES, NULL)) {
- c (is->tagprefix, "Not yet sending duplicate fetch/refresh %s command\n", ic->name);
- return TRUE;
- }
+ if (imapx_match_active_job (is, job_types, NULL) == NULL)
+ return FALSE;
- return FALSE;
+ c (is->tagprefix, "Not yet sending duplicate fetch/refresh %s command\n", ic->name);
+
+ return TRUE;
}
/* See if we can start another task yet.
@@ -1113,7 +1120,7 @@ imapx_command_start_next (CamelIMAPXServer *is)
c (is->tagprefix, "-- %3d '%s'?\n", (gint) ic->pri, ic->name);
if (!ic->select || ((ic->select == folder) &&
- !duplicate_fetch_or_refresh (is, ic))) {
+ !imapx_is_duplicate_fetch_or_refresh (is, ic))) {
c (is->tagprefix, "--> starting '%s'\n", ic->name);
min_pri = ic->pri;
g_queue_push_tail (&start, link);
@@ -1187,7 +1194,7 @@ imapx_command_start_next (CamelIMAPXServer *is)
break;
if (!ic->select || (ic->select == folder &&
- !duplicate_fetch_or_refresh (is, ic))) {
+ !imapx_is_duplicate_fetch_or_refresh (is, ic))) {
c (is->tagprefix, "* queueing job %3d '%s'\n", (gint) ic->pri, ic->name);
min_pri = ic->pri;
g_queue_push_tail (&start, link);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]