[geary] Don't consider message HTML using class="body" for remote image updates.
- From: Adam Dingle <adamd src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Don't consider message HTML using class="body" for remote image updates.
- Date: Tue, 12 Apr 2016 08:50:59 +0000 (UTC)
commit 4625e947285def9a70f9fca38e4dd57519bc9701
Author: Michael James Gratton <mike vee net>
Date: Tue Apr 12 12:23:40 2016 +1000
Don't consider message HTML using class="body" for remote image updates.
If a message body also uses class="body" on an element containing a
remote image, then the IMG element wil be processed more than once and
the allow_prefix added more than once, breaking remote image load.
Bug 764919
* src/client/conversation-viewer/conversation-viewer.vala
(show_images_email): Use Util.DOM.select to ensure we only get the
Geary .body element, and not any in the HTML of the message body. Do
the same for the remote_images DIV.
.../conversation-viewer/conversation-viewer.vala | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala
b/src/client/conversation-viewer/conversation-viewer.vala
index ba807aa..9d1f34d 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -1480,12 +1480,10 @@ public class ConversationViewer : Gtk.Box {
private void show_images_email(WebKit.DOM.Element email_element, bool remember) {
try {
- WebKit.DOM.NodeList body_nodes = email_element.query_selector_all(".body");
- for (ulong j = 0; j < body_nodes.length; j++) {
- WebKit.DOM.Element? body = body_nodes.item(j) as WebKit.DOM.Element;
- if (body == null)
- continue;
-
+ WebKit.DOM.Element body = Util.DOM.select(email_element, ".body");
+ if (body == null) {
+ warning("Could not find message body");
+ } else {
WebKit.DOM.NodeList nodes = body.query_selector_all("img");
for (ulong i = 0; i < nodes.length; i++) {
WebKit.DOM.Element? element = nodes.item(i) as WebKit.DOM.Element;
@@ -1501,7 +1499,7 @@ public class ConversationViewer : Gtk.Box {
}
}
- WebKit.DOM.Element? remote_images = email_element.query_selector(".remote_images");
+ WebKit.DOM.Element? remote_images = Util.DOM.select(email_element, ".remote_images");
if (remote_images != null)
remote_images.get_class_list().remove("show");
} catch (Error error) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]