diff options
author | George Hazan <george.hazan@gmail.com> | 2023-05-19 12:27:52 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-05-19 12:27:52 +0300 |
commit | f68f7312935f37e21597cbecf9cabc0705dea6d8 (patch) | |
tree | e09faacf1158b5e9239c89cb75a4999b5b5019ec /protocols/Telegram/src | |
parent | bad63f163e2821b04b0647a696500bfea58005c2 (diff) |
Telegram: suport for animations (GIFs)
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r-- | protocols/Telegram/src/utils.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp index a694069694..1ddd2a4440 100644 --- a/protocols/Telegram/src/utils.cpp +++ b/protocols/Telegram/src/utils.cpp @@ -346,6 +346,20 @@ CMStringA CTelegramProto::GetMessageText(TG_USER *pUser, const TD::message *pMsg }
break;
+ case TD::messageAnimation::ID:
+ {
+ auto *pDoc = (TD::messageAnimation *)pBody;
+ auto *pVideo = pDoc->animation_.get();
+ CMStringA fileName(FORMAT, "%s (%d x %d, %d %s)", TranslateU("Video"), pVideo->width_, pVideo->height_, pVideo->duration_, TranslateU("seconds"));
+ std::string caption = fileName.c_str();
+ if (!pDoc->caption_->text_.empty()) {
+ caption += " ";
+ caption += pDoc->caption_->text_;
+ }
+ GetMessageFile(TG_FILE_REQUEST::VIDEO, pUser, pVideo->animation_.get(), pVideo->file_name_.c_str(), caption, szId, pszUserId, pMsg->date_);
+ }
+ break;
+
case TD::messageVoiceNote::ID:
{
auto *pDoc = (TD::messageVoiceNote *)pBody;
|