From e8d87a2a9668b085167a55eb8ae2fd4c1df44c82 Mon Sep 17 00:00:00 2001 From: Karrq Date: Tue, 10 May 2022 20:57:19 +0200 Subject: Telegram detection defaults to webZ if not webK (#19) --- recipes/telegram/webview.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'recipes/telegram/webview.js') diff --git a/recipes/telegram/webview.js b/recipes/telegram/webview.js index f05b43f..632aff0 100644 --- a/recipes/telegram/webview.js +++ b/recipes/telegram/webview.js @@ -9,7 +9,6 @@ module.exports = Ferdium => { .querySelector('meta[name="application-name"]') ?.getAttribute('content'); - const isWebZ = telegramVersion?.includes('WebZ'); const isWebK = telegramVersion?.includes('WebK'); // There are two different Telegram versions for internal competition @@ -60,20 +59,20 @@ module.exports = Ferdium => { }; const getMessages = () => { - if (isWebZ) { - webZCount(); - } else if (isWebK) { + if (isWebK) { webKCount(); + } else { + webZCount(); } }; const getActiveDialogTitle = () => { let element; - if (isWebZ) { - element = document.querySelector('.chat-list .ListItem .title > h3'); - } else if (isWebK) { + if (isWebK) { element = document.querySelector('.top .peer-title'); + } else { + element = document.querySelector('.chat-list .ListItem .title > h3'); } Ferdium.setDialogTitle(element ? element.textContent : ''); -- cgit v1.2.3-70-g09d2