From a1d4ef315aa12a409d55e694384c1c1a3fa4bcc3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 29 Apr 2023 18:46:37 +0300 Subject: fixes #3330 (support for pictures, videos, voice messages in Telegram) --- protocols/Telegram/src/proto.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'protocols/Telegram/src/proto.cpp') diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index a8f36fbe2e..a32e1571b3 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -280,6 +280,21 @@ INT_PTR CTelegramProto::GetCaps(int type, MCONTACT) ///////////////////////////////////////////////////////////////////////////////////////// +MEVENT CTelegramProto::RecvFile(MCONTACT hContact, PROTORECVFILE *pre) +{ + MEVENT hEvent = CSuper::RecvFile(hContact, pre); + if (hEvent) + if (auto *ft = (TG_FILE_REQUEST *)pre->lParam) { + DBVARIANT dbv = { DBVT_DWORD }; + dbv.dVal = ft->m_type; + db_event_setJson(hEvent, "t", &dbv); + } + + return hEvent; +} + +///////////////////////////////////////////////////////////////////////////////////////// + void CTelegramProto::OnSearchResults(td::ClientManager::Response &response) { m_searchIds.clear(); -- cgit v1.2.3