[evolution-data-server] Bug #674257 - Recheck attachment availability on message download



commit 100636c625be5d57b2ed2639d2de2bce7322a352
Author: Milan Crha <mcrha redhat com>
Date:   Fri Apr 27 09:37:17 2012 +0200

    Bug #674257 - Recheck attachment availability on message download

 camel/providers/imapx/camel-imapx-folder.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index d9c4c21..20c8ae9 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -554,6 +554,23 @@ imapx_get_message_sync (CamelFolder *folder,
 		}
 		g_mutex_unlock (ifolder->stream_lock);
 		g_object_unref (stream);
+
+		if (msg) {
+			CamelMessageInfo *mi = camel_folder_summary_get (folder->summary, uid);
+
+			if (mi) {
+				gboolean has_attachment;
+
+				has_attachment = camel_mime_message_has_attachment (msg);
+				if (((camel_message_info_flags (mi) & CAMEL_MESSAGE_ATTACHMENTS) && !has_attachment) ||
+				    ((camel_message_info_flags (mi) & CAMEL_MESSAGE_ATTACHMENTS) == 0 && has_attachment)) {
+					camel_message_info_set_flags (mi,
+						CAMEL_MESSAGE_ATTACHMENTS, has_attachment ? CAMEL_MESSAGE_ATTACHMENTS : 0);
+				}
+
+				camel_message_info_free (mi);
+			}
+		}
 	}
 
 	return msg;



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