[PATCH 2/3] Be careful to also fetch properly the first level text attachments
- From: José Dapena Paz <jdapena igalia com>
- Subject: [PATCH 2/3] Be careful to also fetch properly the first level text attachments
- Date: Tue, 22 Dec 2009 18:58:33 +0100
* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c:
detect properly also TEXT stored mime parts in bodystruct.
---
ChangeLog | 3 +++
.../camel/providers/imap/camel-imap-folder.c | 20 ++++++++++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ed16ab8..af58c5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2009-12-22 Jose Dapena Paz <jdapena igalia com>
+ * libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c:
+ detect properly also TEXT stored mime parts in bodystruct.
+
* libtinymail-camel/camel-lite/bs/bodystruct.c: also
consider VIDEO mime types with file/attachment format.
diff --git a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
index f68ab8e..6a32172 100644
--- a/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
+++ b/libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
@@ -4812,6 +4812,13 @@ imap_get_cache_filename (CamelFolder *folder, const char *uid, const char *spec,
}
g_free (check);
+ check = g_strdup_printf ("%s/%s_%s.TEXT_ENCODED", imap_folder->cache->path, uid, spec);
+ if (g_file_test (check, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
+ *state = CAMEL_FOLDER_PART_STATE_CACHED_ENCODED;
+ return check;
+ }
+
+ g_free (check);
check = g_strdup_printf ("%s/%s_%s_CONVERTED", imap_folder->cache->path, uid, spec);
if (g_file_test (check, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
*state = CAMEL_FOLDER_PART_STATE_CACHED_CONVERTED;
@@ -5098,6 +5105,19 @@ imap_fetch (CamelFolder *folder, const char *uid, const char *spec, gboolean *bi
}
}
+ if (!found) {
+ g_free (path);
+ path = g_strdup_printf ("%s/%s_%s.TEXT_ENCODED", imap_folder->cache->path, uid, spec);
+ found = g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR);
+ if (found) {
+ if (binary)
+ *binary = FALSE;
+ } else if (binary && *binary) {
+ g_free (path);
+ path = g_strdup_printf ("%s/%s_%s", imap_folder->cache->path, uid, spec);
+ }
+ }
+
if (!found)
{
if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->parent_store), ex)) {
--
1.6.3.3
--=-Iwo0I4zw/MZdOy8D2GEc
Content-Disposition: attachment; filename*0=0003-Proper-part-spec-for-top-member-of-a-bodystruct-hier.pat; filename*1=ch
Content-Type: text/x-patch; name="0003-Proper-part-spec-for-top-member-of-a-bodystruct-hier.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]