* src/modest-tny-msg.c:
authorJose Dapena Paz <jdapena@igalia.com>
Wed, 19 Sep 2007 21:09:30 +0000 (21:09 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Wed, 19 Sep 2007 21:09:30 +0000 (21:09 +0000)
        * (add_attachments): we don't add purged attachments to
          constructed messages (fixes NB#66088).

pmo-trunk-r3357

src/modest-tny-msg.c

index 56fe1e1..36cfc47 100644 (file)
@@ -267,9 +267,11 @@ add_attachments (TnyMsg *msg, GList *attachments_list)
        for (pos = (GList *)attachments_list; pos; pos = pos->next) {
 
                old_attachment = pos->data;
        for (pos = (GList *)attachments_list; pos; pos = pos->next) {
 
                old_attachment = pos->data;
-               attachment_part = copy_mime_part (old_attachment);
-               tny_mime_part_add_part (TNY_MIME_PART (msg), attachment_part);
-               g_object_unref (attachment_part);
+               if (!tny_mime_part_is_purged (old_attachment)) {
+                       attachment_part = copy_mime_part (old_attachment);
+                       tny_mime_part_add_part (TNY_MIME_PART (msg), attachment_part);
+                       g_object_unref (attachment_part);
+               }
        }
 }
 
        }
 }