diff options
Diffstat (limited to 'protocols/Telegram/src/proto.cpp')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index cd88af4b70..a07932b3d4 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -307,6 +307,26 @@ int CTelegramProto::FileResume(HANDLE hTransfer, int, const wchar_t *pwszFilenam return 0; } +//////////////////////////////////////////////////////////////////////////////////////// +// RecvFile - writes down an incoming file transfer to db + +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_UTF8 }; + dbv.pszVal = ft->m_uniqueId.GetBuffer(); + db_event_setJson(hEvent, "u", &dbv); + + dbv.type = DBVT_DWORD; + dbv.dVal = ft->m_fileId; + db_event_setJson(hEvent, "id", &dbv); + } + } + return hEvent; +} + ///////////////////////////////////////////////////////////////////////////////////////// void CTelegramProto::OnSearchResults(td::ClientManager::Response &response) |