aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-27 05:52:13 +0800
committerDan Winship <danw@src.gnome.org>2000-04-27 05:52:13 +0800
commit9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8 (patch)
tree4516224d8c527419cbe658e1411a575f733a977f /composer/e-msg-composer.c
parent82071abd45b2dbc7874c3556fbc03a503cf29bd3 (diff)
downloadgsoc2013-evolution-9f81c2c796e9e93d643eed11d9e6f7d31a9eb4d8.tar.gz
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
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c20
1 files changed, 11 insertions, 9 deletions
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. */