+2009-04-27 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #478239
+
+ * camel-mime-message.h: (camel_mime_message_has_attachment):
+ * camel-mime-message.c: (camel_mime_message_has_attachment),
+ (find_attachment): New helper function to check whether
+ message contains any 'attachment' part.
+
2009-04-24 Milan Crha <mcrha@redhat.com>
** Part of fix for bug #563954
return ret;
}
+static gboolean
+find_attachment (CamelMimeMessage *msg, CamelMimePart *part, void *data)
+{
+ const char *disp;
+ gboolean *found = (gboolean *)data;
+
+ g_return_val_if_fail (part != NULL, FALSE);
+
+ disp = camel_mime_part_get_disposition (part);
+
+ if (disp) {
+ CamelContentDisposition *cd = camel_content_disposition_decode (disp);
+
+ if (cd) {
+ *found = (cd->disposition && g_ascii_strcasecmp (cd->disposition, "attachment") == 0);
+
+ camel_content_disposition_unref (cd);
+ }
+ }
+
+ return ! (*found);
+}
+
+/**
+ * camel_mime_message_has_attachment:
+ * @message: a #CamelMimeMessage object
+ *
+ * Returns whether message contains at least one attachment part.
+ **/
+gboolean
+camel_mime_message_has_attachment (CamelMimeMessage *message)
+{
+ gboolean found = FALSE;
+
+ g_return_val_if_fail (message != NULL, FALSE);
+
+ camel_mime_message_foreach_part (message, find_attachment, &found);
+
+ return found;
+}
+
static void
cmm_dump_rec(CamelMimeMessage *msg, CamelMimePart *part, int body, int depth)
{
char *camel_mime_message_build_mbox_from (CamelMimeMessage *message);
+gboolean camel_mime_message_has_attachment (CamelMimeMessage *message);
+
void camel_mime_message_dump(CamelMimeMessage *msg, int body);
G_END_DECLS
+2009-04-27 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #478239
+
+ * camel-imap-folder.c: (imap_get_message):
+ Check whether message has really attachment part when claiming so.
+
2009-03-09 Matthew Barnes <mbarnes@redhat.com>
* camel-imap-summary.c (camel_imap_summary_new):
camel_folder_summary_touch (mi->info.summary);
}
}
+
+ if ((mi->info.flags & CAMEL_MESSAGE_ATTACHMENTS) && !camel_mime_message_has_attachment (msg)) {
+ mi->info.flags = mi->info.flags & ~CAMEL_MESSAGE_ATTACHMENTS;
+ mi->info.dirty = TRUE;
+
+ if (mi->info.summary)
+ camel_folder_summary_touch (mi->info.summary);
+ }
}
fail:
camel_message_info_free(&mi->info);
+2009-04-27 Milan Crha <mcrha@redhat.com>
+
+ ** Part of fix for bug #478239
+
+ * camel-mbox-folder.c: (mbox_append_message):
+ * camel-maildir-folder.c: (maildir_append_message):
+ * camel-mh-folder.c: (mh_append_message):
+ Check whether message has really attachment part when claiming so.
+
2009-04-24 Milan Crha <mcrha@redhat.com>
** Part of fix for bug #563954
mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
if (camel_exception_is_set (ex))
return;
-
+
+ if ((camel_message_info_flags (mi) & CAMEL_MESSAGE_ATTACHMENTS) && !camel_mime_message_has_attachment (message))
+ camel_message_info_set_flags (mi, CAMEL_MESSAGE_ATTACHMENTS, 0);
+
mdi = (CamelMaildirMessageInfo *)mi;
d(printf("Appending message: uid is %s filename is %s\n", camel_message_info_uid(mi), mdi->filename));
d(printf("Appending message: uid is %s\n", camel_message_info_uid(mi)));
+ if ((camel_message_info_flags (mi) & CAMEL_MESSAGE_ATTACHMENTS) && !camel_mime_message_has_attachment (message))
+ camel_message_info_set_flags (mi, CAMEL_MESSAGE_ATTACHMENTS, 0);
+
output_stream = camel_stream_fs_new_with_name(lf->folder_path, O_WRONLY | O_APPEND | O_LARGEFILE, 0666);
if (output_stream == NULL) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
mi = camel_local_summary_add((CamelLocalSummary *)folder->summary, message, info, lf->changes, ex);
if (camel_exception_is_set (ex))
return;
-
+
+ if ((camel_message_info_flags (mi) & CAMEL_MESSAGE_ATTACHMENTS) && !camel_mime_message_has_attachment (message))
+ camel_message_info_set_flags (mi, CAMEL_MESSAGE_ATTACHMENTS, 0);
+
d(printf("Appending message: uid is %s\n", camel_message_info_uid(mi)));
/* write it out, use the uid we got from the summary */