aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-05-11 04:43:50 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-05-11 04:43:50 +0800
commitf6f8e3c3e8273c8eedbfb27019912d7a575aa321 (patch)
tree9d50752452ad5daed44064732eee43182f6a0f5e /composer/e-msg-composer.c
parent42f9d72254cc07858ea32170583f1cc94d7f5f9c (diff)
downloadgsoc2013-evolution-f6f8e3c3e8273c8eedbfb27019912d7a575aa321.tar
gsoc2013-evolution-f6f8e3c3e8273c8eedbfb27019912d7a575aa321.tar.gz
gsoc2013-evolution-f6f8e3c3e8273c8eedbfb27019912d7a575aa321.tar.bz2
gsoc2013-evolution-f6f8e3c3e8273c8eedbfb27019912d7a575aa321.tar.lz
gsoc2013-evolution-f6f8e3c3e8273c8eedbfb27019912d7a575aa321.tar.xz
gsoc2013-evolution-f6f8e3c3e8273c8eedbfb27019912d7a575aa321.tar.zst
gsoc2013-evolution-f6f8e3c3e8273c8eedbfb27019912d7a575aa321.zip
If we are creating a message with only a single part (ie no attachments
2001-05-10 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (build_message): If we are creating a message with only a single part (ie no attachments and we will not be signing/encrypting the part) then `part = CAMEL_MIME_PART(message)` otherwise create a new MIME part and set it's content-object as the message's content-object at a later date. svn path=/trunk/; revision=9749
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 01c28dabb0..bfa11d0507 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -412,7 +412,11 @@ build_message (EMsgComposer *composer)
camel_object_unref (CAMEL_OBJECT (body));
break;
case MSG_FORMAT_PLAIN:
- part = camel_mime_part_new ();
+ /* FIXME: this is just evil... */
+ if (!(composer->pgp_sign || composer->pgp_encrypt))
+ part = CAMEL_MIME_PART (new);
+ else
+ part = camel_mime_part_new ();
content_type = best_content (plain);
camel_mime_part_set_content (CAMEL_MIME_PART (part), plain, strlen (plain), content_type);
@@ -482,15 +486,20 @@ build_message (EMsgComposer *composer)
goto exception;
}
- camel_medium_set_content_object (CAMEL_MEDIUM (new),
- camel_medium_get_content_object (CAMEL_MEDIUM (part)));
- camel_object_unref (CAMEL_OBJECT (part));
+ /* set the toplevel mime part of the message */
+ if (part != CAMEL_MIME_PART (new)) {
+ camel_medium_set_content_object (CAMEL_MEDIUM (new),
+ camel_medium_get_content_object (CAMEL_MEDIUM (part)));
+ camel_object_unref (CAMEL_OBJECT (part));
+ }
return new;
exception:
- camel_object_unref (CAMEL_OBJECT (part));
+ if (part != CAMEL_MIME_PART (new))
+ camel_object_unref (CAMEL_OBJECT (part));
+
camel_object_unref (CAMEL_OBJECT (new));
if (camel_exception_is_set (&ex)) {