From 01a9556b9c2c179f20c6ca5f99996595dcbfc5a5 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 6 Dec 2022 11:10:43 +0100 Subject: [PATCH] Don't request remote avatars in mobile mode --- plugins/avatars/avatars.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/avatars/avatars.js b/plugins/avatars/avatars.js index ab4d95c62..b211d7a22 100644 --- a/plugins/avatars/avatars.js +++ b/plugins/avatars/avatars.js @@ -34,6 +34,8 @@ `; }; + let isMobile; + const queue = [], avatars = new Map, @@ -160,9 +162,11 @@ fn = url=>{element.src = url}; if (url) { fn(url); - } else if (msg.avatar) { + } else if (msg.avatar || isMobile()) { if (msg.avatar.startsWith('data:')) { fn(msg.avatar); + } else if (isMobile()) { + setIdenticon(from, fn); } else { element.onerror = () => setIdenticon(from, fn); fn(`?Avatar/${'pass' == from.dkimStatus ? 1 : 0}/${msg.avatar}`); @@ -215,6 +219,7 @@ } if ('MailMessageList' === e.detail.viewModelTemplateID) { + isMobile = e.detail.isMobile; document.getElementById('MailMessageList').content.querySelector('.messageCheckbox') .append(Element.fromHTML(``)); }