Patch: fix attachments detection in IMAP



	Hi,

	Minor fixes for attachment detection in imap.

Changelog:
* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
  (message_from_data): don't free the message before evaluating
  headers. Also take into account the case we get ms has attachments but
  we don't have priority flag, for avoiding using heuristics.

-- 
Jose Dapena Paz <jdapena igalia com>
Igalia
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 3489)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2008-03-14  Jose Dapena Paz  <jdapena igalia com>
+
+	* libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
+	(message_from_data): don't free the message before evaluating
+	headers. Also take into account the case we get ms has attachments but
+	we don't have priority flag, for avoiding using heuristics.
+
 2008-03-03  Philip Van Hoof <pvanhoof gnome org>
 
 	* IMAP provider: bugfix when asking for a list of folders that has no
Index: libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c
===================================================================
--- libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c	(revision 3489)
+++ libtinymail-camel/camel-lite/camel/providers/imap/camel-imap-folder.c	(working copy)
@@ -2988,7 +2988,6 @@
 	}
 
 	mi = (CamelImapMessageInfo *)camel_folder_summary_info_new_from_message (folder->summary, msg);
-	camel_object_unref (CAMEL_OBJECT (msg));
 
 	size = GPOINTER_TO_INT (g_datalist_get_data (&data, "RFC822.SIZE"));
 	if (size)
@@ -3001,7 +3000,7 @@
 		!camel_header_raw_find(&h, "X-MS-Has-Attach", NULL)) {
 		/**/
 		((CamelMessageInfoBase *)mi)->flags &= ~CAMEL_MESSAGE_ATTACHMENTS;
-	} else {
+	} else if (!camel_header_raw_find (&h, "X-MS-Has-Attach", NULL)) {
 		/* TNY TODO: This is a hack! But else we need to parse
 		 * BODYSTRUCTURE (and I'm lazy). It needs fixing though. */
 
@@ -3011,6 +3010,7 @@
 
 	}
 
+	camel_object_unref (CAMEL_OBJECT (msg));
 	/* This overrides Received: (although it wont be found by the messages
 	 * fed to message_info_new_from_header, as this header is not in the
 	 * query. Leaving them out makes retrieving summary consume a lot less


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