[evolution-data-server/imap-pop-mobile: 6/12] Decided return type based on the fetch type.



commit 098281aab7b384ccef8e25e07a8827bb14627123
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 6ffaa3f..dc5aa4d 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -6216,7 +6216,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);
@@ -6267,7 +6269,13 @@ camel_imapx_server_fetch_messages (CamelIMAPXServer *is,
 
 	camel_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]