From e0351a793ac8b20ec7aa5819564774dff443e68b Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Mon, 22 Aug 2022 11:01:04 +0200 Subject: [PATCH] Disable custom emoji --- .env | 4 ++-- src/lib/appManagers/appMessagesManager.ts | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.env b/.env index fb8ddee4..8b60b348 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ API_ID=1025907 API_HASH=452b0359b988148995f22ff0f4229750 VERSION=1.5.0 -VERSION_FULL=1.5.0 (223) -BUILD=223 +VERSION_FULL=1.5.0 (224) +BUILD=224 diff --git a/src/lib/appManagers/appMessagesManager.ts b/src/lib/appManagers/appMessagesManager.ts index 40534f5e..41890c44 100644 --- a/src/lib/appManagers/appMessagesManager.ts +++ b/src/lib/appManagers/appMessagesManager.ts @@ -2722,8 +2722,8 @@ export class AppMessagesManager extends AppManager { } } */ + let unsupported = false; if(isMessage && message.media) { - let unsupported = false; switch(message.media._) { case 'messageMediaEmpty': { delete message.media; @@ -2787,13 +2787,17 @@ export class AppMessagesManager extends AppManager { break; } } + } - if(unsupported) { - message.media = {_: 'messageMediaUnsupported'}; - message.message = ''; - delete message.entities; - delete message.totalEntities; - } + if(isMessage && !unsupported && message.entities) { + unsupported = message.entities.some((entity) => entity._ === 'messageEntityCustomEmoji'); + } + + if(isMessage && unsupported) { + message.media = {_: 'messageMediaUnsupported'}; + message.message = ''; + delete message.entities; + delete message.totalEntities; } if(!isMessage && message.action) {