aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-05-28 08:42:19 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-05-28 08:42:19 +0800
commitde9458db315d8857bfae6929b2585150c20a57cf (patch)
tree6e0bd08287b3d05b3c97c3f509ed57aa820a53cd /camel/providers
parentd575bb994eebbe511b80bb07abda56d28a9883e3 (diff)
downloadgsoc2013-evolution-de9458db315d8857bfae6929b2585150c20a57cf.tar
gsoc2013-evolution-de9458db315d8857bfae6929b2585150c20a57cf.tar.gz
gsoc2013-evolution-de9458db315d8857bfae6929b2585150c20a57cf.tar.bz2
gsoc2013-evolution-de9458db315d8857bfae6929b2585150c20a57cf.tar.lz
gsoc2013-evolution-de9458db315d8857bfae6929b2585150c20a57cf.tar.xz
gsoc2013-evolution-de9458db315d8857bfae6929b2585150c20a57cf.tar.zst
gsoc2013-evolution-de9458db315d8857bfae6929b2585150c20a57cf.zip
This should finish fixing all variations of bug #42854, which, funnily
2003-05-27 Jeffrey Stedfast <fejj@ximian.com> This should finish fixing all variations of bug #42854, which, funnily enough specified "copying" as the scenario for reproducing this bug, but somehow I found/fixed it only for expunging for some reason? I can't even guess as to how this happened. Oh well, expunging needed fixing either way. * providers/imap/camel-imap-folder.c (imap_transfer_online): Sort the uids here too (just like I had fixed for expunge a week or so ago). (imap_transfer_resyncing): Sort them here too. (imap_search_by_uids): Sort here too, even though I don't think it is necessary. Can't hurt. (imap_expunge_uids_offline): Might as well sort here too. svn path=/trunk/; revision=21341
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 16638d3902..a3fbb9baf3 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -823,12 +823,30 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
CAMEL_SERVICE_UNLOCK (store, connect_lock);
}
+static int
+uid_compar (const void *va, const void *vb)
+{
+ const char **sa = (const char **)va, **sb = (const char **)vb;
+ unsigned long a, b;
+
+ a = strtoul (*sa, NULL, 10);
+ b = strtoul (*sb, NULL, 10);
+ if (a < b)
+ return -1;
+ else if (a == b)
+ return 0;
+ else
+ return 1;
+}
+
static void
imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
{
CamelFolderChangeInfo *changes;
int i;
-
+
+ qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+
changes = camel_folder_change_info_new ();
for (i = 0; i < uids->len; i++) {
@@ -847,22 +865,6 @@ imap_expunge_uids_offline (CamelFolder *folder, GPtrArray *uids, CamelException
camel_folder_change_info_free (changes);
}
-static int
-uid_compar (const void *va, const void *vb)
-{
- const char **sa = (const char **)va, **sb = (const char **)vb;
- unsigned long a, b;
-
- a = strtoul (*sa, NULL, 10);
- b = strtoul (*sb, NULL, 10);
- if (a < b)
- return -1;
- else if (a == b)
- return 0;
- else
- return 1;
-}
-
static void
imap_expunge_uids_online (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
{
@@ -1435,7 +1437,9 @@ imap_transfer_online (CamelFolder *source, GPtrArray *uids,
return;
count = camel_folder_summary_count (dest->summary);
-
+
+ qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+
/* Now copy the messages */
do_copy (source, uids, dest, ex);
if (camel_exception_is_set (ex))
@@ -1469,7 +1473,9 @@ imap_transfer_resyncing (CamelFolder *source, GPtrArray *uids,
const char *uid;
CamelMimeMessage *message;
CamelMessageInfo *info;
-
+
+ qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+
/* This is trickier than append_resyncing, because some of
* the messages we are copying may have been copied or
* appended into @source while we were offline, in which case
@@ -1565,7 +1571,9 @@ imap_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids
/* NOTE: could get away without the search lock by creating a new
search object each time */
-
+
+ qsort (uids->pdata, uids->len, sizeof (void *), uid_compar);
+
summary = g_ptr_array_new();
for (i=0;i<uids->len;i++) {
CamelMessageInfo *info;