From 0bd330eedee899893ef921284a265d635d027f6b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Nov 2023 13:28:18 +0300 Subject: =?UTF-8?q?fixes=20#3991=20(NewStory:=20=D0=B4=D0=BE=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D1=82=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=8E=20=D0=B6=D1=83=D1=80=D0=BD=D0=B0=D0=BB=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/avatars.cpp | 13 ++++++++++--- protocols/Telegram/src/proto.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/Telegram/src/avatars.cpp b/protocols/Telegram/src/avatars.cpp index e304fd6e0b..9f6e9e6436 100644 --- a/protocols/Telegram/src/avatars.cpp +++ b/protocols/Telegram/src/avatars.cpp @@ -97,19 +97,26 @@ void CTelegramProto::OnGetFileInfo(td::ClientManager::Response &response, void * SendQuery(new TD::downloadFile(pFile->id_, 10, 0, 0, true)); } +void CTelegramProto::OnGetFileLink(td::ClientManager::Response &response) +{ + if (!response.object) + return; + +} + void __cdecl CTelegramProto::OfflineFileThread(void *pParam) { auto *ofd = (OFDTHREAD *)pParam; DB::EventInfo dbei(ofd->hDbEvent); if (dbei && !strcmp(dbei.szModule, m_szModuleName) && dbei.eventType == EVENTTYPE_FILE) { - JSONNode root = JSONNode::parse((const char *)dbei.pBlob); - if (root) { + if (!ofd->bCopy) { auto *ft = new TG_FILE_REQUEST(TG_FILE_REQUEST::FILE, 0, ""); ft->ofd = ofd; m_arFiles.insert(ft); - SendQuery(new TD::getRemoteFile(root["u"].as_string(), 0), &CTelegramProto::OnGetFileInfo, ft); + DB::FILE_BLOB blob(dbei); + SendQuery(new TD::getRemoteFile(blob.getUrl(), 0), &CTelegramProto::OnGetFileInfo, ft); } } else delete ofd; diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index a88e1699b1..32cec7fa60 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -222,6 +222,7 @@ class CTelegramProto : public PROTO void OnEndSession(td::ClientManager::Response &response); void OnGetFileInfo(td::ClientManager::Response &response, void *pUserInfo); + void OnGetFileLink(td::ClientManager::Response &response); void OnGetHistory(td::ClientManager::Response &response, void *pUserInfo); void OnSendFile(td::ClientManager::Response &response, void *pUserInfo); void OnSendMessage(td::ClientManager::Response &response); -- cgit v1.2.3