From 65082d3cc4f7fe8e2f25b3ef367ab7c6a002b4cb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 7 Jun 2023 19:10:47 +0300 Subject: =?UTF-8?q?fixes=20#3546=20(Telegram:=20=D0=B5=D1=81=D0=BB=D0=B8?= =?UTF-8?q?=20=D0=BE=D1=82=D1=81=D1=83=D1=82=D1=81=D1=82=D0=B2=D1=83=D0=B5?= =?UTF-8?q?=D1=82=20SmileyAdd,=20=D1=82=D0=BE=20=D0=BD=D0=B5=D1=82=20?= =?UTF-8?q?=D0=BD=D0=B8=D0=BA=D0=B0=D0=BA=D0=BE=D0=B9=20=D0=B8=D0=BD=D0=B4?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BE=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D1=88=D0=B5=D0=B4=D1=88=D0=B5=D0=BC=20=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BA=D0=B5=D1=80=D0=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/utils.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'protocols/Telegram') diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index eab4d893f6..5aedf57407 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -427,11 +427,16 @@ CMStringA CTelegramProto::GetMessageText(TG_USER *pUser, const TD::message *pMsg break; case TD::messageSticker::ID: - if (m_bSmileyAdd) { + { auto *pSticker = ((TD::messageSticker *)pBody)->sticker_.get(); - if (pSticker->full_type_->get_id() != TD::stickerTypeRegular::ID) + if (pSticker->full_type_->get_id() != TD::stickerTypeRegular::ID) { + debugLogA("You received a sticker of unsupported type %d, ignored", pSticker->full_type_->get_id()); break; - + } + + if (!m_bSmileyAdd) + return CMStringA(FORMAT, "%s: %s", TranslateU("You received a sticker"), pSticker->emoji_.c_str()); + const char *pwszFileExt; switch (pSticker->format_->get_id()) { case TD::stickerFormatTgs::ID: pwszFileExt = "tga"; break; @@ -442,8 +447,6 @@ CMStringA CTelegramProto::GetMessageText(TG_USER *pUser, const TD::message *pMsg return GetMessageSticker(pSticker->thumbnail_->file_.get(), pwszFileExt); } - else debugLogA("SmileyAdd plugin isn't installed, skipping sticker"); - break; case TD::messageText::ID: auto pText = ((TD::messageText *)pBody)->text_.get(); -- cgit v1.2.3