diff options
Diffstat (limited to 'protocols/Telegram')
-rw-r--r-- | protocols/Telegram/src/menus.cpp | 4 | ||||
-rw-r--r-- | protocols/Telegram/src/utils.cpp | 14 |
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;
|