aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
Diffstat (limited to 'em-format')
-rw-r--r--em-format/em-format-quote.c8
-rw-r--r--em-format/em-format.c3
-rw-r--r--em-format/em-inline-filter.c2
3 files changed, 10 insertions, 3 deletions
diff --git a/em-format/em-format-quote.c b/em-format/em-format-quote.c
index a8f1bf329a..a5a8d0de65 100644
--- a/em-format/em-format-quote.c
+++ b/em-format/em-format-quote.c
@@ -94,8 +94,11 @@ emfq_format_clone (EMFormat *emf,
EM_FORMAT_CLASS (parent_class)->format_clone (
emf, folder, uid, msg, src, cancellable);
+ g_seekable_seek (
+ G_SEEKABLE (emfq->priv->stream),
+ 0, G_SEEK_SET, NULL, NULL);
+
gconf = gconf_client_get_default ();
- camel_stream_reset (emfq->priv->stream, NULL);
if (gconf_client_get_bool (
gconf, "/apps/evolution/mail/composer/top_signature", NULL))
camel_stream_printf (emfq->priv->stream, "<br>\n");
@@ -257,6 +260,9 @@ em_format_quote_new (const gchar *credits,
g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
+ /* Steam must also be seekable so we can reset its position. */
+ g_return_val_if_fail (G_IS_SEEKABLE (stream), NULL);
+
emfq = g_object_new (EM_TYPE_FORMAT_QUOTE, NULL);
emfq->priv->credits = g_strdup (credits);
diff --git a/em-format/em-format.c b/em-format/em-format.c
index 1f9634d29f..1c2624f1f6 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -1422,7 +1422,8 @@ em_format_format_text (EMFormat *emf,
(CamelStream *) filter_stream, cancellable, NULL);
camel_stream_flush ((CamelStream *) filter_stream, cancellable, NULL);
g_object_unref (filter_stream);
- camel_stream_reset (mem_stream, NULL);
+
+ g_seekable_seek (G_SEEKABLE (mem_stream), 0, G_SEEK_SET, NULL, NULL);
if (max == -1 || size == -1 || size < (max * 1024) || emf->composer) {
camel_stream_write_to_stream (
diff --git a/em-format/em-inline-filter.c b/em-format/em-inline-filter.c
index c7a8014f6b..1f9639540e 100644
--- a/em-format/em-inline-filter.c
+++ b/em-format/em-inline-filter.c
@@ -121,7 +121,7 @@ inline_filter_add_part (EMInlineFilter *emif, const gchar *data, gint len)
}
emif->data = g_byte_array_new ();
- camel_stream_reset (mem, NULL);
+ g_seekable_seek (G_SEEKABLE (mem), 0, G_SEEK_SET, NULL, NULL);
dw = camel_data_wrapper_new ();
if (encoding == emif->base_encoding && (encoding == CAMEL_TRANSFER_ENCODING_BASE64 || encoding == CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE)) {