summaryrefslogtreecommitdiff
path: root/protocols/Telegram
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-30 13:28:18 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-30 13:28:18 +0300
commit0bd330eedee899893ef921284a265d635d027f6b (patch)
treef295c3ca9950ba6cd01ca49439dbb89c745a751d /protocols/Telegram
parent932c6454190cccc4a3dd26b42e439f26104df1dc (diff)
fixes #3991 (NewStory: доработка контекстного меню журнала)
Diffstat (limited to 'protocols/Telegram')
-rw-r--r--protocols/Telegram/src/avatars.cpp13
-rw-r--r--protocols/Telegram/src/proto.h1
2 files changed, 11 insertions, 3 deletions
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<CTelegramProto>
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);