diff options
author | George Hazan <george.hazan@gmail.com> | 2023-06-07 19:10:47 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-06-07 19:10:47 +0300 |
commit | 65082d3cc4f7fe8e2f25b3ef367ab7c6a002b4cb (patch) | |
tree | 7cadb4158eab98e2a3afae80ad55e1eb9902ee19 | |
parent | 285bec1935c0776b761374d8e545a6a5af7f96c9 (diff) |
fixes #3546 (Telegram: если отсутствует SmileyAdd, то нет никакой индикации о пришедшем стикере)
-rw-r--r-- | protocols/Telegram/src/utils.cpp | 13 |
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();
|