* [gentoo-commits] gentoo-x86 commit in mail-client/evolution/files: evolution-3.8.4-pop3-removal.patch
@ 2013-08-09 17:35 Pacho Ramos (pacho)
0 siblings, 0 replies; only message in thread
From: Pacho Ramos (pacho) @ 2013-08-09 17:35 UTC (permalink / raw
To: gentoo-commits
pacho 13/08/09 17:35:12
Added: evolution-3.8.4-pop3-removal.patch
Log:
Fix 'Old POP3 mails can be removed before getting them, upstream bug #705446', drop old
(Portage version: 2.1.13.7/cvs/Linux x86_64, signed Manifest commit with key A188FBD4)
Revision Changes Path
1.1 mail-client/evolution/files/evolution-3.8.4-pop3-removal.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-client/evolution/files/evolution-3.8.4-pop3-removal.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-client/evolution/files/evolution-3.8.4-pop3-removal.patch?rev=1.1&content-type=text/plain
Index: evolution-3.8.4-pop3-removal.patch
===================================================================
From 8b8ddbd16eeb3217a7a15b59e8f966b61d989977 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Thu, 08 Aug 2013 05:48:49 +0000
Subject: Bug #705446 - Old POP3 mails can be removed before getting them
---
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index dccd001..643b82c 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -348,7 +348,7 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
g_object_ref (fm->destination);
}
- if (!local_error) {
+ if (!local_error && !g_cancellable_is_cancelled (cancellable)) {
folder_uids = camel_folder_get_uids (folder);
cache_uids = camel_uid_cache_get_new_uids (cache, folder_uids);
@@ -373,11 +373,26 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
g_cancellable_reset (m->cancellable);
if (!success) {
+ GPtrArray *uncached_uids;
+ GHashTable *uncached_hash;
+
+ uncached_uids = camel_folder_get_uncached_uids (folder, cache_uids, NULL);
+ uncached_hash = g_hash_table_new (g_str_hash, g_str_equal);
+
+ for (i = 0; uncached_uids && i < uncached_uids->len; i++) {
+ g_hash_table_insert (uncached_hash, uncached_uids->pdata[i], uncached_uids->pdata[i]);
+ }
+
/* re-enter known UIDs, thus they are not
* re-fetched next time */
for (i = 0; i < cache_uids->len; i++) {
- camel_uid_cache_save_uid (cache, cache_uids->pdata[i]);
+ /* skip uncached UIDs */
+ if (!g_hash_table_lookup (uncached_hash, cache_uids->pdata[i]))
+ camel_uid_cache_save_uid (cache, cache_uids->pdata[i]);
}
+
+ g_hash_table_destroy (uncached_hash);
+ camel_folder_free_uids (folder, uncached_uids);
}
/* save the cache of uids that we've just downloaded */
@@ -433,9 +448,18 @@ exit:
/* also disconnect if not a local delivery mbox;
* there is no need to keep the connection alive forever */
- if (!is_local_delivery)
+ if (!is_local_delivery) {
+ gboolean was_cancelled;
+
+ was_cancelled = g_cancellable_is_cancelled (cancellable);
+
+ /* pity, but otherwise it doesn't disconnect */
+ if (was_cancelled)
+ g_cancellable_reset (cancellable);
+
camel_service_disconnect_sync (
- service, TRUE, cancellable, NULL);
+ service, !was_cancelled, cancellable, NULL);
+ }
g_object_unref (session);
}
--
cgit v0.9.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-08-09 17:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-09 17:35 [gentoo-commits] gentoo-x86 commit in mail-client/evolution/files: evolution-3.8.4-pop3-removal.patch Pacho Ramos (pacho)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox