summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-24 13:41:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-24 13:41:41 +0300
commit7a11ce58becfc750e5b4a9bb07102f8d334bbcf6 (patch)
treed8d28c73c4f3c5b5953b7785e374e38e89de7580 /protocols
parentcce43e30dca000d713131a87ddd78265d71eb763 (diff)
Telegram: silent file transfers don't require f/t manager, but simply create offline events
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Telegram/src/proto.cpp32
-rw-r--r--protocols/Telegram/src/proto.h4
-rw-r--r--protocols/Telegram/src/utils.cpp2
3 files changed, 1 insertions, 37 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index 11bed96d85..172b299ebc 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -278,38 +278,6 @@ INT_PTR CTelegramProto::GetCaps(int type, MCONTACT)
}
}
-/////////////////////////////////////////////////////////////////////////////////////////
-
-HANDLE CTelegramProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t *pwszSavePath)
-{
- auto *ft = (TG_FILE_REQUEST *)hTransfer;
- if (ft == nullptr)
- return nullptr;
-
- ft->m_destPath = pwszSavePath;
- ft->pfts.szCurrentFile.w = ft->m_fileName.GetBuffer();
- ft->pfts.szWorkingDir.w = ft->m_destPath.GetBuffer();
- SendQuery(new TD::downloadFile(ft->m_fileId, 5, 0, 0, false));
- return ft;
-}
-
-int CTelegramProto::FileCancel(MCONTACT, HANDLE hTransfer)
-{
- auto *ft = (TG_FILE_REQUEST *)hTransfer;
- delete ft;
- return 1;
-}
-
-int CTelegramProto::FileResume(HANDLE hTransfer, int, const wchar_t *pwszFilename)
-{
- auto *ft = (TG_FILE_REQUEST *)hTransfer;
- if (ft == nullptr)
- return 1;
-
- ft->m_destPath = pwszFilename;
- return 0;
-}
-
////////////////////////////////////////////////////////////////////////////////////////
// RecvFile - writes down an incoming file transfer to db
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index 25c4bd9af3..95c98a0739 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -286,10 +286,6 @@ public:
MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr);
- HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override;
- int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
- int FileResume(HANDLE hTransfer, int action, const wchar_t *szFilename) override;
-
INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
MEVENT RecvFile(MCONTACT hContact, PROTORECVFILE *pre) override;
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp
index 28b3204cf7..99887aa661 100644
--- a/protocols/Telegram/src/utils.cpp
+++ b/protocols/Telegram/src/utils.cpp
@@ -270,7 +270,7 @@ CMStringA CTelegramProto::GetMessageText(TG_USER *pUser, const TD::message *pMsg
auto *pszFileName = pDoc->document_->file_name_.c_str();
PROTORECVFILE pre = {};
- pre.dwFlags = PRFF_UTF;
+ pre.dwFlags = PRFF_UTF | PRFF_SILENT;
pre.fileCount = 1;
pre.timestamp = time(0);
pre.files.a = &pszFileName;