[evolution-data-server/email-factory-3-4] Decided return type based on the fetch type.



commit b1d44e987ec28aedc0e92a19afa8032b6fa7f66b
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Thu Jan 12 15:47:22 2012 +0530

    Decided return type based on the fetch type.

 camel/providers/imapx/camel-imapx-server.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 9f16d4c..4963a1c 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -6321,7 +6321,9 @@ camel_imapx_server_fetch_messages (CamelIMAPXServer *is,
 	gboolean success = TRUE;
 	unsigned long long firstuid, newfirstuid;
 	gchar *uid;
- 
+ 	int old_len;
+
+	old_len = camel_folder_summary_count (folder->summary);
 	uid = imapx_get_uid_from_index (folder->summary, 0);
 	firstuid = strtoull(uid, NULL, 10);
 	g_free (uid);
@@ -6366,7 +6368,13 @@ camel_imapx_server_fetch_messages (CamelIMAPXServer *is,
 
 	imapx_job_unref (job);
 
-	return firstuid != newfirstuid;
+	if (type == CAMEL_FETCH_OLD_MESSAGES && firstuid == newfirstuid)
+		return FALSE; /* No more old messages */
+	else if (type == CAMEL_FETCH_NEW_MESSAGES &&
+			old_len == camel_folder_summary_count (folder->summary))
+		return FALSE; /* No more new messages */
+
+	return TRUE;
 }
 
 gboolean



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