summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-06-07 19:10:47 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-06-07 19:10:47 +0300
commit65082d3cc4f7fe8e2f25b3ef367ab7c6a002b4cb (patch)
tree7cadb4158eab98e2a3afae80ad55e1eb9902ee19
parent285bec1935c0776b761374d8e545a6a5af7f96c9 (diff)
fixes #3546 (Telegram: если отсутствует SmileyAdd, то нет никакой индикации о пришедшем стикере)
-rw-r--r--protocols/Telegram/src/utils.cpp13
1 files changed, 8 insertions, 5 deletions
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();