From f4ef74c6eacbc7fc2d557e4b3b12c9e7b7680dc8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 8 May 2025 14:28:21 +0300 Subject: =?UTF-8?q?fixes=20#5014=20(Telegram:=20"=D0=B7=D0=B0=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=B5=D0=B2=D0=B0=D0=B5=D1=82"=20=D0=BE=D1=82=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/src/proto.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'protocols/Telegram/src/proto.cpp') diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index 6e59c6c983..a420a65122 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -462,6 +462,15 @@ void CTelegramProto::ProcessFileMessage(TG_FILE_REQUEST *ft, const TD::message * return; } + // if that file was sent once, it might be cached at the server & reused + if (auto *pRemote = pFile->remote_.get()) { + if (pRemote->is_uploading_completed_) { + ProtoBroadcastAck(ft->m_hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft); + delete ft; + return; + } + } + char szUserId[100]; auto szMsgId(msg2id(pMsg)); -- cgit v1.2.3