[evolution-data-server/email-factory] Fetch POP mails in reverse order so that new mails are downloaded first.



commit f460a9c3830bc3e2bf5610a89e30e7a536a86839
Author: Srinivasa Ragavan <sragavan gnome org>
Date:   Tue May 31 03:36:11 2011 +0530

    Fetch POP mails in reverse order so that new mails are downloaded first.

 mail/daemon/mail-ops.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/mail/daemon/mail-ops.c b/mail/daemon/mail-ops.c
index 06d7509..958815a 100644
--- a/mail/daemon/mail-ops.c
+++ b/mail/daemon/mail-ops.c
@@ -353,10 +353,12 @@ fetch_mail_exec (struct _fetch_mail_msg *m)
 					/* need to copy this, sigh */
 					fm->source_uids = uids = g_ptr_array_new ();
 					g_ptr_array_set_size (uids, cache_uids->len);
+
+					/* Reverse it so that we fetch the latest as first, while fetching POP  */
 					for (i = 0; i < cache_uids->len; i++)
-						uids->pdata[i] = g_strdup (cache_uids->pdata[i]);
-					camel_uid_cache_free_uids (cache_uids);
+						uids->pdata[cache_uids->len-i-1] = g_strdup (cache_uids->pdata[i]);
 
+					camel_uid_cache_free_uids (cache_uids);
 					fm->cache = cache;
 					em_filter_folder_element_exec (fm);
 



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