#include <tny-folder.h>
#include <modest-runtime.h>
#include "modest-formatter.h"
-#include <tny-camel-stream.h>
+#include <tny-camel-mem-stream.h>
#include <tny-camel-mime-part.h>
-#include <camel/camel-stream-buffer.h>
-#include <camel/camel-stream-mem.h>
#include <glib/gprintf.h>
#include <modest-tny-folder.h>
#include "modest-tny-mime-part.h"
TnyStream *text_body_stream;
/* Create the stream */
- text_body_stream = TNY_STREAM (tny_camel_stream_new
- (camel_stream_mem_new_with_buffer
- (body, (body ? strlen(body) : 0))));
+ text_body_stream = TNY_STREAM (tny_camel_mem_stream_new_with_buffer
+ (body, (body ? strlen(body) : 0)));
text_body_part = modest_formatter_create_body_part (NULL, msg);
TnyStream *html_body_stream;
/* Create the stream */
- html_body_stream = TNY_STREAM (tny_camel_stream_new
- (camel_stream_mem_new_with_buffer
- (body, strlen(body))));
+ html_body_stream = TNY_STREAM (tny_camel_mem_stream_new_with_buffer
+ (body, strlen(body)));
/* Create body part if needed */
html_body_part = modest_formatter_create_body_part (NULL, msg);
TnyList *parts = NULL;
TnyIterator *iter = NULL;
gchar *header_content_type;
- gchar *header_content_type_lower;
+ gchar *header_content_type_lower = NULL;
if (!msg)
return NULL;
/* If it's an application multipart, then we don't get into as we don't
* support them (for example application/sml or wap messages */
header_content_type = modest_tny_mime_part_get_header_value (msg, "Content-Type");
- header_content_type = g_strstrip (header_content_type);
- header_content_type_lower = header_content_type?g_ascii_strdown (header_content_type, -1):NULL;
+ if (header_content_type) {
+ header_content_type = g_strstrip (header_content_type);
+ header_content_type_lower = g_ascii_strdown (header_content_type, -1);
+ }
if (header_content_type_lower &&
g_str_has_prefix (header_content_type_lower, "multipart/") &&
+ !g_str_has_prefix (header_content_type_lower, "multipart/signed") &&
strstr (header_content_type_lower, "application/")) {
g_free (header_content_type_lower);
g_free (header_content_type);