[evolution/gnome-3-20] Inline images in drafts are not displayed in GMail



commit f556b57821e6faddf3eedba701e892334d9399e0
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Mar 30 10:12:38 2016 +0200

    Inline images in drafts are not displayed in GMail
    
    GMail is not allowing base64 images so we have to always save them as CID ones.

 composer/e-msg-composer.c   |    3 ++-
 e-util/e-html-editor-view.c |   22 ++++++++++++++++++++++
 e-util/e-html-editor-view.h |    4 ++++
 3 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index e3a242c..5f7f73f 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1361,7 +1361,8 @@ composer_build_message (EMsgComposer *composer,
                        if (!selection_saved)
                                e_html_editor_selection_save (selection);
 
-                       text = e_html_editor_view_get_text_html_for_drafts (view);
+                       text = e_html_editor_view_get_text_html_for_drafts_with_images (
+                               view, from_domain, &inline_images);
 
                        e_html_editor_view_remove_embed_styles (view);
                        e_html_editor_selection_restore (selection);
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index 2fd51b0..0c8b72f 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -12158,6 +12158,28 @@ e_html_editor_view_get_text_html (EHTMLEditorView *view,
        return html;
 }
 
+gchar *
+e_html_editor_view_get_text_html_for_drafts_with_images (EHTMLEditorView *view,
+                                                         const gchar *from_domain,
+                                                         GList **inline_images)
+{
+       gchar *html = NULL;
+       GHashTable *inline_images_to_restore = NULL;
+
+       g_return_val_if_fail (E_IS_HTML_EDITOR_VIEW (view), NULL);
+
+       if (inline_images && from_domain)
+               *inline_images = html_editor_view_get_parts_for_inline_images (
+                       view, from_domain, &inline_images_to_restore);
+
+       html = process_content_for_saving_as_draft (view, FALSE);
+
+       if (inline_images && from_domain && inline_images_to_restore)
+               html_editor_view_restore_images (view, &inline_images_to_restore);
+
+       return html;
+}
+
 /**
  * e_html_editor_view_get_text_html_for_drafts:
  * @view: an #EHTMLEditorView:
diff --git a/e-util/e-html-editor-view.h b/e-util/e-html-editor-view.h
index d1f857a..386574e 100644
--- a/e-util/e-html-editor-view.h
+++ b/e-util/e-html-editor-view.h
@@ -207,6 +207,10 @@ gchar *            e_html_editor_view_get_text_html
                                                (EHTMLEditorView *view,
                                                 const gchar *from_domain,
                                                 GList **inline_images);
+gchar *                e_html_editor_view_get_text_html_for_drafts_with_images
+                                               (EHTMLEditorView *view,
+                                                const gchar *from_domain,
+                                                GList **inline_images);
 gchar *                e_html_editor_view_get_text_html_for_drafts
                                                (EHTMLEditorView *view);
 gchar *                e_html_editor_view_get_body_text_html_for_drafts


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