[evolution/gnome-3-8] EMailRequest: Handle empty message bodies more gracefully.



commit 1fb3bda9b954e2c442808d42ef6a004c2ad3f134
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jul 19 12:23:17 2013 -0400

    EMailRequest: Handle empty message bodies more gracefully.
    
    (cherry picked from commit 8a0bb568238483e65ba0e053ddca0e47fb01040f)

 mail/e-mail-request.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/mail/e-mail-request.c b/mail/e-mail-request.c
index a4e229f..85faa19 100644
--- a/mail/e-mail-request.c
+++ b/mail/e-mail-request.c
@@ -176,9 +176,15 @@ handle_mail_request (GSimpleAsyncResult *res,
        context.part_list = NULL;
 
        /* Convert the GString to GInputStream and send it back to WebKit */
-       ba = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (request->priv->output_stream));
-       if (!ba->data) {
-               gchar *data = g_strdup_printf (_("Failed to load part '%s'"), part_id);
+       ba = camel_stream_mem_get_byte_array (
+               CAMEL_STREAM_MEM (request->priv->output_stream));
+       if (ba->data == NULL) {
+               gchar *data;
+
+               /* XXX Text was added after 3.8.0; not translated. */
+               data = g_strdup_printf (
+                       "<p align='center'>%s</p>",
+                       "The message has no text content.");
                dd (printf ("%s", data));
                g_byte_array_append (ba, (guchar *) data, strlen (data));
                g_free (data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]