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/package.json | 2 +- recipes/telegram/webview.js | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/recipes/telegram/package.json b/recipes/telegram/package.json index acc0a54..54843eb 100644 --- a/recipes/telegram/package.json +++ b/recipes/telegram/package.json @@ -1,7 +1,7 @@ { "id": "telegram", "name": "Telegram", - "version": "3.3.0", + "version": "3.3.1", "license": "MIT", "config": { "serviceURL": "https://web.telegram.org", 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-54-g00ecf