generalsettingsview: add an option to disable images loading in the chatview
Displaying images in the chatview can lead to unwanted requests, the
user must be able to disable this functionnality.
Change-Id: I522b22fc603ff6adb36bcb7a560fa8d7a1b9bdb7
Reviewed-by: Philippe Gorley <philippe.gorley@savoirfairelinux.com>
diff --git a/src/webkitchatcontainer.cpp b/src/webkitchatcontainer.cpp
index 2b6062a..1663729 100644
--- a/src/webkitchatcontainer.cpp
+++ b/src/webkitchatcontainer.cpp
@@ -486,6 +486,22 @@
}
void
+webkit_chat_container_set_display_links(WebKitChatContainer *view, bool display)
+{
+ WebKitChatContainerPrivate *priv = WEBKIT_CHAT_CONTAINER_GET_PRIVATE(view);
+ gchar* function_call = g_strdup_printf("ring.chatview.setDisplayLinks(%s);",
+ display ? "true" : "false");
+
+ webkit_web_view_run_javascript(
+ WEBKIT_WEB_VIEW(priv->webview_chat),
+ function_call,
+ NULL,
+ NULL,
+ NULL
+ );
+}
+
+void
webkit_chat_container_clear_sender_images(WebKitChatContainer *view)
{
WebKitChatContainerPrivate *priv = WEBKIT_CHAT_CONTAINER_GET_PRIVATE(view);