diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-24 13:41:41 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-24 13:41:41 +0300 |
commit | 7a11ce58becfc750e5b4a9bb07102f8d334bbcf6 (patch) | |
tree | d8d28c73c4f3c5b5953b7785e374e38e89de7580 /src/core/stdfile | |
parent | cce43e30dca000d713131a87ddd78265d71eb763 (diff) |
Telegram: silent file transfers don't require f/t manager, but simply create offline events
Diffstat (limited to 'src/core/stdfile')
-rw-r--r-- | src/core/stdfile/src/file.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 159a421fe6..b1f8f3670f 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -358,6 +358,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) blob.write(dbei);
}
+ bool bShow = (pre->dwFlags & PRFF_SILENT) == 0;
MEVENT hdbe = db_event_add(ccs->hContact, &dbei);
CLISTEVENT cle = {};
@@ -365,19 +366,21 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) cle.hDbEvent = hdbe;
cle.lParam = pre->lParam;
- if (g_plugin.bAutoAccept && Contact::OnList(ccs->hContact))
+ if (bShow && g_plugin.bAutoAccept && Contact::OnList(ccs->hContact))
LaunchRecvDialog(&cle);
else {
Skin_PlaySound("RecvFile");
- wchar_t szTooltip[256];
- mir_snwprintf(szTooltip, TranslateT("File from %s"), Clist_GetContactDisplayName(ccs->hContact));
- cle.szTooltip.w = szTooltip;
+ if (bShow) {
+ wchar_t szTooltip[256];
+ mir_snwprintf(szTooltip, TranslateT("File from %s"), Clist_GetContactDisplayName(ccs->hContact));
+ cle.szTooltip.w = szTooltip;
- cle.flags |= CLEF_UNICODE;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
- cle.pszService = "SRFile/RecvFile";
- g_clistApi.pfnAddEvent(&cle);
+ cle.flags |= CLEF_UNICODE;
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
+ cle.pszService = "SRFile/RecvFile";
+ g_clistApi.pfnAddEvent(&cle);
+ }
}
return hdbe;
|