|
|
6159b2 |
diff -up evolution-3.22.6/mail/e-http-request.c.remote-content-cache evolution-3.22.6/mail/e-http-request.c
|
|
|
6159b2 |
--- evolution-3.22.6/mail/e-http-request.c.remote-content-cache 2016-09-19 10:22:58.000000000 +0200
|
|
|
6159b2 |
+++ evolution-3.22.6/mail/e-http-request.c 2017-03-24 13:47:48.814647889 +0100
|
|
|
6159b2 |
@@ -186,7 +186,7 @@ e_http_request_process_sync (EContentReq
|
|
|
6159b2 |
GError **error)
|
|
|
6159b2 |
{
|
|
|
6159b2 |
SoupURI *soup_uri;
|
|
|
6159b2 |
- gchar *evo_uri, *use_uri;
|
|
|
6159b2 |
+ gchar *evo_uri = NULL, *use_uri;
|
|
|
6159b2 |
gchar *mail_uri = NULL;
|
|
|
6159b2 |
GInputStream *stream;
|
|
|
6159b2 |
gboolean force_load_images = FALSE;
|
|
|
6159b2 |
@@ -221,6 +221,14 @@ e_http_request_process_sync (EContentReq
|
|
|
6159b2 |
|
|
|
6159b2 |
g_hash_table_remove (query, "__evo-mail");
|
|
|
6159b2 |
|
|
|
6159b2 |
+ /* Required, because soup_uri_set_query_from_form() can change
|
|
|
6159b2 |
+ order of arguments, then the URL checksum doesn't match. */
|
|
|
6159b2 |
+ evo_uri = g_hash_table_lookup (query, "__evo-original-uri");
|
|
|
6159b2 |
+ if (evo_uri)
|
|
|
6159b2 |
+ evo_uri = g_strdup (evo_uri);
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ g_hash_table_remove (query, "__evo-original-uri");
|
|
|
6159b2 |
+
|
|
|
6159b2 |
/* Remove __evo-load-images if present (and in such case set
|
|
|
6159b2 |
* force_load_images to TRUE) */
|
|
|
6159b2 |
force_load_images = g_hash_table_remove (query, "__evo-load-images");
|
|
|
6159b2 |
@@ -229,7 +237,8 @@ e_http_request_process_sync (EContentReq
|
|
|
6159b2 |
g_hash_table_unref (query);
|
|
|
6159b2 |
}
|
|
|
6159b2 |
|
|
|
6159b2 |
- evo_uri = soup_uri_to_string (soup_uri, FALSE);
|
|
|
6159b2 |
+ if (!evo_uri)
|
|
|
6159b2 |
+ evo_uri = soup_uri_to_string (soup_uri, FALSE);
|
|
|
6159b2 |
|
|
|
6159b2 |
if (camel_debug_start ("emformat:requests")) {
|
|
|
6159b2 |
printf (
|
|
|
6159b2 |
diff -up evolution-3.22.6/mail/e-mail-display.c.remote-content-cache evolution-3.22.6/mail/e-mail-display.c
|
|
|
6159b2 |
--- evolution-3.22.6/mail/e-mail-display.c.remote-content-cache 2017-03-24 13:47:48.803647890 +0100
|
|
|
6159b2 |
+++ evolution-3.22.6/mail/e-mail-display.c 2017-03-24 13:47:48.814647889 +0100
|
|
|
6159b2 |
@@ -1745,6 +1745,10 @@ mail_display_uri_requested_cb (EWebView
|
|
|
6159b2 |
enc = soup_uri_encode (mail_uri, NULL);
|
|
|
6159b2 |
g_hash_table_insert (query, g_strdup ("__evo-mail"), enc);
|
|
|
6159b2 |
|
|
|
6159b2 |
+ /* Required, because soup_uri_set_query_from_form() can change
|
|
|
6159b2 |
+ order of arguments, then the URL checksum doesn't match. */
|
|
|
6159b2 |
+ g_hash_table_insert (query, g_strdup ("__evo-original-uri"), g_strdup (uri));
|
|
|
6159b2 |
+
|
|
|
6159b2 |
if (display->priv->force_image_load || can_download_uri) {
|
|
|
6159b2 |
g_hash_table_insert (
|
|
|
6159b2 |
query,
|
|
|
6159b2 |
diff -up evolution-3.22.6/modules/webkit-editor/e-webkit-editor.c.remote-content-cache evolution-3.22.6/modules/webkit-editor/e-webkit-editor.c
|
|
|
6159b2 |
--- evolution-3.22.6/modules/webkit-editor/e-webkit-editor.c.remote-content-cache 2017-03-24 13:47:48.804647890 +0100
|
|
|
6159b2 |
+++ evolution-3.22.6/modules/webkit-editor/e-webkit-editor.c 2017-03-24 13:50:26.450640886 +0100
|
|
|
6159b2 |
@@ -23,6 +23,8 @@
|
|
|
6159b2 |
#include "web-extension/e-editor-web-extension-names.h"
|
|
|
6159b2 |
|
|
|
6159b2 |
#include <e-util/e-util.h>
|
|
|
6159b2 |
+#include "mail/e-http-request.h"
|
|
|
6159b2 |
+
|
|
|
6159b2 |
#include <string.h>
|
|
|
6159b2 |
|
|
|
6159b2 |
#define E_WEBKIT_EDITOR_GET_PRIVATE(obj) \
|
|
|
6159b2 |
@@ -4989,9 +4991,58 @@ webkit_editor_get_web_extension (EWebKit
|
|
|
6159b2 |
}
|
|
|
6159b2 |
|
|
|
6159b2 |
static void
|
|
|
6159b2 |
+webkit_editor_uri_request_done_cb (GObject *source_object,
|
|
|
6159b2 |
+ GAsyncResult *result,
|
|
|
6159b2 |
+ gpointer user_data)
|
|
|
6159b2 |
+{
|
|
|
6159b2 |
+ WebKitURISchemeRequest *request = user_data;
|
|
|
6159b2 |
+ GInputStream *stream = NULL;
|
|
|
6159b2 |
+ gint64 stream_length = -1;
|
|
|
6159b2 |
+ gchar *mime_type = NULL;
|
|
|
6159b2 |
+ GError *error = NULL;
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ g_return_if_fail (E_IS_CONTENT_REQUEST (source_object));
|
|
|
6159b2 |
+ g_return_if_fail (WEBKIT_IS_URI_SCHEME_REQUEST (request));
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ if (!e_content_request_process_finish (E_CONTENT_REQUEST (source_object),
|
|
|
6159b2 |
+ result, &stream, &stream_length, &mime_type, &error)) {
|
|
|
6159b2 |
+ webkit_uri_scheme_request_finish_error (request, error);
|
|
|
6159b2 |
+ g_clear_error (&error);
|
|
|
6159b2 |
+ } else {
|
|
|
6159b2 |
+ webkit_uri_scheme_request_finish (request, stream, stream_length, mime_type);
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ g_clear_object (&stream);
|
|
|
6159b2 |
+ g_free (mime_type);
|
|
|
6159b2 |
+ }
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ g_object_unref (request);
|
|
|
6159b2 |
+}
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+static void
|
|
|
6159b2 |
+webkit_editor_process_uri_request_cb (WebKitURISchemeRequest *request,
|
|
|
6159b2 |
+ gpointer user_data)
|
|
|
6159b2 |
+{
|
|
|
6159b2 |
+ EContentRequest *content_request = user_data;
|
|
|
6159b2 |
+ const gchar *uri;
|
|
|
6159b2 |
+ GObject *requester;
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ g_return_if_fail (WEBKIT_IS_URI_SCHEME_REQUEST (request));
|
|
|
6159b2 |
+ g_return_if_fail (E_IS_CONTENT_REQUEST (content_request));
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ uri = webkit_uri_scheme_request_get_uri (request);
|
|
|
6159b2 |
+ requester = G_OBJECT (webkit_uri_scheme_request_get_web_view (request));
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ g_return_if_fail (e_content_request_can_process_uri (content_request, uri));
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+ e_content_request_process (content_request, uri, requester, NULL,
|
|
|
6159b2 |
+ webkit_editor_uri_request_done_cb, g_object_ref (request));
|
|
|
6159b2 |
+}
|
|
|
6159b2 |
+
|
|
|
6159b2 |
+static void
|
|
|
6159b2 |
webkit_editor_constructed (GObject *object)
|
|
|
6159b2 |
{
|
|
|
6159b2 |
EWebKitEditor *wk_editor;
|
|
|
6159b2 |
+ EContentRequest *content_request;
|
|
|
6159b2 |
gchar **languages;
|
|
|
6159b2 |
WebKitWebContext *web_context;
|
|
|
6159b2 |
WebKitSettings *web_settings;
|
|
|
6159b2 |
@@ -5012,6 +5063,13 @@ webkit_editor_constructed (GObject *obje
|
|
|
6159b2 |
webkit_web_context_set_spell_checking_languages (web_context, (const gchar * const *) languages);
|
|
|
6159b2 |
g_strfreev (languages);
|
|
|
6159b2 |
|
|
|
6159b2 |
+ content_request = e_http_request_new ();
|
|
|
6159b2 |
+ webkit_web_context_register_uri_scheme (web_context, "evo-http", webkit_editor_process_uri_request_cb,
|
|
|
6159b2 |
+ g_object_ref (content_request), g_object_unref);
|
|
|
6159b2 |
+ webkit_web_context_register_uri_scheme (web_context, "evo-https", webkit_editor_process_uri_request_cb,
|
|
|
6159b2 |
+ g_object_ref (content_request), g_object_unref);
|
|
|
6159b2 |
+ g_object_unref (content_request);
|
|
|
6159b2 |
+
|
|
|
6159b2 |
webkit_web_view_set_editable (web_view, TRUE);
|
|
|
6159b2 |
|
|
|
6159b2 |
web_settings = webkit_web_view_get_settings (web_view);
|
|
|
6159b2 |
diff -up evolution-3.22.6/modules/webkit-editor/Makefile.am.remote-content-cache evolution-3.22.6/modules/webkit-editor/Makefile.am
|
|
|
6159b2 |
--- evolution-3.22.6/modules/webkit-editor/Makefile.am.remote-content-cache 2017-03-24 13:51:12.164638855 +0100
|
|
|
6159b2 |
+++ evolution-3.22.6/modules/webkit-editor/Makefile.am 2017-03-24 13:51:23.553638350 +0100
|
|
|
6159b2 |
@@ -21,6 +21,7 @@ module_webkit_editor_la_SOURCES = \
|
|
|
6159b2 |
|
|
|
6159b2 |
module_webkit_editor_la_LIBADD = \
|
|
|
6159b2 |
$(top_builddir)/e-util/libevolution-util.la \
|
|
|
6159b2 |
+ $(top_builddir)/mail/libevolution-mail.la \
|
|
|
6159b2 |
$(EVOLUTION_DATA_SERVER_LIBS) \
|
|
|
6159b2 |
$(GNOME_PLATFORM_LIBS) \
|
|
|
6159b2 |
$(NULL)
|