mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-07 09:33:39 +02:00
Fixed original message view not/showing images
This commit is contained in:
@@ -58,7 +58,6 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
||||
private IWebView intf;
|
||||
private Runnable onPageLoaded;
|
||||
private String hash;
|
||||
private Boolean images;
|
||||
|
||||
private static String userAgent = null;
|
||||
|
||||
@@ -247,6 +246,10 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
||||
|
||||
void setImages(boolean show_images, boolean inline) {
|
||||
WebSettings settings = getSettings();
|
||||
|
||||
if (settings.getLoadsImagesAutomatically() != show_images)
|
||||
this.hash = null;
|
||||
|
||||
settings.setLoadsImagesAutomatically(show_images || inline);
|
||||
settings.setBlockNetworkLoads(!show_images);
|
||||
settings.setBlockNetworkImage(!show_images);
|
||||
@@ -256,14 +259,10 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
||||
public void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl) {
|
||||
try {
|
||||
// Prevent flickering
|
||||
boolean i = getSettings().getLoadsImagesAutomatically();
|
||||
if (Objects.equals(this.images, i)) {
|
||||
String h = (data == null ? null : Helper.md5(data.getBytes()));
|
||||
if (Objects.equals(this.hash, h))
|
||||
return;
|
||||
this.hash = h;
|
||||
} else
|
||||
this.images = i;
|
||||
String h = (data == null ? null : Helper.md5(data.getBytes()));
|
||||
if (Objects.equals(this.hash, h))
|
||||
return;
|
||||
this.hash = h;
|
||||
} catch (Throwable ex) {
|
||||
Log.w(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user