diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-27 05:52:13 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-27 05:52:13 +0800 |
commit | 9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8 (patch) | |
tree | 4516224d8c527419cbe658e1411a575f733a977f | |
parent | 82071abd45b2dbc7874c3556fbc03a503cf29bd3 (diff) | |
download | gsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.tar gsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.tar.gz gsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.tar.bz2 gsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.tar.lz gsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.tar.xz gsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.tar.zst gsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.zip |
Only generate a multipart message if there are attachments. Otherwise
* e-msg-composer.c (build_message): Only generate a multipart
message if there are attachments. Otherwise generate a single
part.
svn path=/trunk/; revision=2648
-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. */ |