summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-28 19:54:43 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-28 19:54:43 +0300
commit55ca3854461d0a399b5fbfe7331e8eb5c8f6fbef (patch)
tree55bd4f0f6f9d0781fe70bc973156be3dad1c251d /protocols/Telegram
parentfc7d7e43522b9c9dcbd27bc193baf566f89deb5b (diff)
Telegram: missing audio file type
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/src/menus.cpp4
-rw-r--r--protocols/Telegram/src/utils.cpp14
2 files changed, 16 insertions, 2 deletions
diff --git a/protocols/Telegram/src/menus.cpp b/protocols/Telegram/src/menus.cpp
index fd57a2e771..5a58072f46 100644
--- a/protocols/Telegram/src/menus.cpp
+++ b/protocols/Telegram/src/menus.cpp
@@ -25,7 +25,7 @@ void CTelegramProto::InitMenus()
return;
CreateProtoService(MenuExecService, &CTelegramProto::SvcExecMenu);
-
+
CMStringA szServiceName(FORMAT, "%s%s", m_szModuleName, MenuExecService);
CMenuItem mi(&g_plugin);
mi.pszService = szServiceName;
@@ -54,7 +54,7 @@ int CTelegramProto::OnPrebuildNSMenu(WPARAM hContact, LPARAM lParam)
Menu_ShowItem(hmiReply, false);
}
else {
- auto *pDbei = (DB::EventInfo*)lParam;
+ auto *pDbei = (DB::EventInfo *)lParam;
Menu_ShowItem(hmiForward, true);
Menu_ShowItem(hmiReply, mir_strlen(pDbei->szId) > 0 && !Contact::IsReadonly(hContact));
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp
index 15a6484a0c..840ee15946 100644
--- a/protocols/Telegram/src/utils.cpp
+++ b/protocols/Telegram/src/utils.cpp
@@ -465,6 +465,20 @@ CMStringA CTelegramProto::GetMessageText(TG_USER *pUser, const TD::message *pMsg
}
break;
+ case TD::messageAudio::ID:
+ {
+ auto *pDoc = (TD::messageAudio *)pBody;
+ auto *pAudio = pDoc->audio_.get();
+ CMStringA fileName(FORMAT, "%s (%d %s)", TranslateU("Audio"), pAudio->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, pAudio->audio_.get(), pAudio->file_name_.c_str(), caption, szId, pszUserId, pMsg);
+ }
+ break;
+
case TD::messageVideo::ID:
{
auto *pDoc = (TD::messageVideo *)pBody;