aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2012-04-19 16:30:55 +0800
committerDan Vrátil <dvratil@redhat.com>2012-04-19 16:30:55 +0800
commitf4c30fef04885ebb69df9fb5b8a61a525c5de948 (patch)
tree8f92afade687b8d6f90c68045996955cf45bfca0 /em-format
parent3fbbdd80ac987f2b9ac0b91b7fd16098bb3240c1 (diff)
downloadgsoc2013-evolution-f4c30fef04885ebb69df9fb5b8a61a525c5de948.tar
gsoc2013-evolution-f4c30fef04885ebb69df9fb5b8a61a525c5de948.tar.gz
gsoc2013-evolution-f4c30fef04885ebb69df9fb5b8a61a525c5de948.tar.bz2
gsoc2013-evolution-f4c30fef04885ebb69df9fb5b8a61a525c5de948.tar.lz
gsoc2013-evolution-f4c30fef04885ebb69df9fb5b8a61a525c5de948.tar.xz
gsoc2013-evolution-f4c30fef04885ebb69df9fb5b8a61a525c5de948.tar.zst
gsoc2013-evolution-f4c30fef04885ebb69df9fb5b8a61a525c5de948.zip
Bug #674249 - Crash when showing message with large text/plain
Diffstat (limited to 'em-format')
-rw-r--r--em-format/em-format.c38
1 files changed, 5 insertions, 33 deletions
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 86fafdd539..c3f790df18 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -2173,9 +2173,6 @@ em_format_format_text (EMFormat *emf,
const gchar *charset = NULL;
CamelMimeFilterWindows *windows = NULL;
CamelStream *mem_stream = NULL;
- gsize size;
- gsize max;
- GSettings *settings;
if (g_cancellable_is_cancelled (cancellable))
return;
@@ -2221,42 +2218,17 @@ em_format_format_text (EMFormat *emf,
g_object_unref (filter);
}
- max = -1;
-
- settings = g_settings_new ("org.gnome.evolution.mail");
- if (g_settings_get_boolean (settings, "force-message-limit")) {
- max = g_settings_get_int (settings, "message-text-part-limit");
- if (max == 0)
- max = -1;
- }
- g_object_unref (settings);
-
- size = camel_data_wrapper_decode_to_stream_sync (
+ camel_data_wrapper_decode_to_stream_sync (
camel_medium_get_content ((CamelMedium *) dw),
- (CamelStream *) filter_stream, cancellable, NULL);
+ (CamelStream *) filter_stream, cancellable, NULL);
camel_stream_flush ((CamelStream *) filter_stream, cancellable, NULL);
g_object_unref (filter_stream);
g_seekable_seek (G_SEEKABLE (mem_stream), 0, G_SEEK_SET, NULL, NULL);
- if (max == -1 || size == -1 || size < (max * 1024) || emf->priv->composer) {
- camel_stream_write_to_stream (
- mem_stream, (CamelStream *) stream, cancellable, NULL);
- camel_stream_flush ((CamelStream *) mem_stream, cancellable, NULL);
- } else {
- /* Parse it as an attachment */
- CamelMimePart *part = camel_mime_part_new ();
- EMFormatParserInfo info = { 0 };
- GString *part_id = g_string_new (".attachment");
- camel_medium_set_content ((CamelMedium *) part, dw);
-
- info.is_attachment = TRUE;
- em_format_parse_part_as (emf, part, part_id, &info,
- "x-evolution/message/attachment", cancellable);
-
- g_string_free (part_id, TRUE);
- g_object_unref (part);
- }
+ camel_stream_write_to_stream (
+ mem_stream, (CamelStream *) stream, cancellable, NULL);
+ camel_stream_flush ((CamelStream *) mem_stream, cancellable, NULL);
if (windows)
g_object_unref (windows);