summaryrefslogtreecommitdiff
path: root/protocols/Telegram/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/src')
-rw-r--r--protocols/Telegram/src/proto.cpp6
-rw-r--r--protocols/Telegram/src/proto.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 79694ac08c..0e5accd74c 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -458,6 +458,7 @@ void CTelegramProto::ProcessFileMessage(TG_FILE_REQUEST *ft, const TD::message *
else {
ft->m_szUserId = szUserId;
ft->m_uniqueId = szMsgId;
+ ProtoBroadcastAck(ft->m_hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft);
}
}
}
@@ -466,8 +467,10 @@ void CTelegramProto::OnSendFile(td::ClientManager::Response &response, void *pUs
{
auto *ft = (TG_FILE_REQUEST *)pUserInfo;
- if (response.object->get_id() == TD::message::ID)
+ if (response.object->get_id() == TD::message::ID) {
ProcessFileMessage(ft, (TD::message *)response.object.get(), false);
+ ProtoBroadcastAck(ft->m_hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft);
+ }
else if (response.object->get_id() == TD::messages::ID) {
int i = 0;
auto *pMessages = (TD::messages *)response.object.get();
@@ -477,7 +480,6 @@ void CTelegramProto::OnSendFile(td::ClientManager::Response &response, void *pUs
}
}
- ProtoBroadcastAck(ft->m_hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, ft);
delete ft;
}
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index 01cbf1e6f3..6731a512aa 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -78,8 +78,8 @@ struct TG_FILE_REQUEST : public MZeroedObject
TD::int53 m_fileId, m_fileSize = 0;
CMStringA m_uniqueId, m_szUserId;
CMStringW m_destPath, m_fileName, m_wszDescr;
- OFDTHREAD *ofd;
- bool m_bRecv;
+ OFDTHREAD *ofd = 0;
+ bool m_bRecv = false;
};
struct TG_USER : public MZeroedObject