diff options
Diffstat (limited to 'composer')
-rw-r--r-- | composer/ChangeLog | 4 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 20 |
2 files changed, 15 insertions, 9 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 9969b45de8..8e0cd2ee0d 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,5 +1,9 @@ 2000-04-26 Dan Winship <danw@helixcode.com> + * e-msg-composer.c (build_message): Only generate a multipart + message if there are attachments. Otherwise generate a single + part. + * Update for CamelMimeBodyPart -> CamelMimePart 2000-04-26 Dan Winship <danw@helixcode.com> diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 81423f39d3..d404146351 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -136,7 +136,6 @@ build_message (EMsgComposer *composer) { CamelMimeMessage *new; CamelMimePart *part; - CamelMultipart *multipart; char *text; int i; @@ -150,21 +149,24 @@ build_message (EMsgComposer *composer) composer->extra_hdr_values->pdata[i]); } - multipart = camel_multipart_new (); part = camel_mime_part_new (); - text = get_editor_text (BONOBO_WIDGET (composer->editor)); camel_mime_part_set_content (part, text, strlen (text), "text/html"); g_free (text); - camel_multipart_add_part (multipart, part); + if (e_msg_composer_attachment_bar_get_num_attachments (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar))) { + CamelMultipart *multipart = camel_multipart_new (); - e_msg_composer_attachment_bar_to_multipart - (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), - multipart); + camel_multipart_add_part (multipart, part); + + e_msg_composer_attachment_bar_to_multipart (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), multipart); - camel_medium_set_content_object (CAMEL_MEDIUM (new), - CAMEL_DATA_WRAPPER (multipart)); + camel_medium_set_content_object (CAMEL_MEDIUM (new), + CAMEL_DATA_WRAPPER (multipart)); + } else { + camel_medium_set_content_object (CAMEL_MEDIUM (new), + CAMEL_DATA_WRAPPER (part)); + } /* FIXME refcounting is most certainly wrong. We want all the stuff to be destroyed when we unref() the message. */ |