diff options
author | George Hazan <george.hazan@gmail.com> | 2023-07-13 12:29:29 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-07-13 12:29:29 +0300 |
commit | 800bd65d79e12f292c6cce64747d921e45228eff (patch) | |
tree | 8b31b3872e82662cb896adae52f06738f0cfce85 /src | |
parent | 641cb4d06283b4f76d539092c92cabeb7192ca6e (diff) |
MS_PROTO_RECVFILET - we don't need this service either
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_app/src/file.cpp | 16 | ||||
-rw-r--r-- | src/mir_app/src/file.h | 7 | ||||
-rw-r--r-- | src/mir_app/src/proto_interface.cpp | 6 |
3 files changed, 14 insertions, 15 deletions
diff --git a/src/mir_app/src/file.cpp b/src/mir_app/src/file.cpp index c9cc489df4..9f3be80c8f 100644 --- a/src/mir_app/src/file.cpp +++ b/src/mir_app/src/file.cpp @@ -317,15 +317,13 @@ INT_PTR openRecDir(WPARAM, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// -static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) +MEVENT Proto_RecvFile(MCONTACT hContact, PROTORECVFILE *pre) { - CCSDATA *ccs = (CCSDATA*)lParam; - PROTORECVFILE* pre = (PROTORECVFILE*)ccs->lParam; if (pre->fileCount == 0) return 0; DB::EventInfo dbei; - dbei.szModule = Proto_GetBaseAccountName(ccs->hContact); + dbei.szModule = Proto_GetBaseAccountName(hContact); dbei.timestamp = pre->timestamp; dbei.szId = pre->szId; dbei.szUserId = pre->szUserId; @@ -369,21 +367,21 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam) } bool bShow = (pre->dwFlags & (PRFF_SILENT | PRFF_SENT)) == 0; - MEVENT hdbe = db_event_add(ccs->hContact, &dbei); + MEVENT hdbe = db_event_add(hContact, &dbei); CLISTEVENT cle = {}; - cle.hContact = ccs->hContact; + cle.hContact = hContact; cle.hDbEvent = hdbe; cle.lParam = pre->lParam; - if (bShow && File::bAutoAccept && Contact::OnList(ccs->hContact)) + if (bShow && File::bAutoAccept && Contact::OnList(hContact)) LaunchRecvDialog(&cle); else { Skin_PlaySound("RecvFile"); if (bShow) { wchar_t szTooltip[256]; - mir_snwprintf(szTooltip, TranslateT("File from %s"), Clist_GetContactDisplayName(ccs->hContact)); + mir_snwprintf(szTooltip, TranslateT("File from %s"), Clist_GetContactDisplayName(hContact)); cle.szTooltip.w = szTooltip; cle.flags |= CLEF_UNICODE; @@ -416,8 +414,6 @@ int LoadSendRecvFileModule(void) hDlgSucceeded = CreateHookableEvent(ME_FILEDLG_SUCCEEDED); hDlgCanceled = CreateHookableEvent(ME_FILEDLG_CANCELED); - CreateServiceFunction(MS_PROTO_RECVFILET, Proto_RecvFileT); - CreateServiceFunction(MS_FILE_SENDFILE, SendFileCommand); CreateServiceFunction(MS_FILE_SENDSPECIFICFILES, SendSpecificFiles); CreateServiceFunction(MS_FILE_SENDSPECIFICFILEST, SendSpecificFilesT); diff --git a/src/mir_app/src/file.h b/src/mir_app/src/file.h index a394721b50..c9b882f9bf 100644 --- a/src/mir_app/src/file.h +++ b/src/mir_app/src/file.h @@ -75,19 +75,22 @@ struct FileDlgData : public MZeroedObject wchar_t szMsg[450], szFilenames[1024]; }; -//file.c +// file.c #define UNITS_BYTES 1 // 0 <= size<1000: "%d bytes" #define UNITS_KBPOINT1 2 // 1000 <= size<100*1024: "%.1f KB" #define UNITS_KBPOINT0 3 // 100*1024 <= size<1024*1024: "%d KB" #define UNITS_MBPOINT2 4 // 1024*1024 <= size: "%.2f MB" #define UNITS_GBPOINT3 5 // 1024*1024*1024 <= size: "%.3f GB" +int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *szValue, wchar_t *szOutput, int cbOutput); + void GetSensiblyFormattedSize(__int64 size, wchar_t *szOut, int cchOut, int unitsOverride, int appendUnits, int *unitsUsed); void FreeFilesMatrix(wchar_t ***files); //loving that triple indirection void FreeProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *fts); void CopyProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src); void UpdateProtoFileTransferStatus(PROTOFILETRANSFERSTATUS *dest, PROTOFILETRANSFERSTATUS *src); -int SRFile_GetRegValue(HKEY hKeyBase, const wchar_t *szSubKey, const wchar_t *szValue, wchar_t *szOutput, int cbOutput); + +MEVENT Proto_RecvFile(MCONTACT hContact, PROTORECVFILE *pre); // filesenddlg.c INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp index 9e3d719126..7029c6295a 100644 --- a/src/mir_app/src/proto_interface.cpp +++ b/src/mir_app/src/proto_interface.cpp @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "stdafx.h"
+#include "file.h"
static HGENMENU hReqAuth = nullptr, hGrantAuth = nullptr, hRevokeAuth = nullptr, hServerHist = nullptr;
@@ -198,10 +199,9 @@ int PROTO_INTERFACE::RecvContacts(MCONTACT, PROTORECVEVENT*) return 1; // error
}
-MEVENT PROTO_INTERFACE::RecvFile(MCONTACT hContact, PROTORECVFILE *pcre)
+MEVENT PROTO_INTERFACE::RecvFile(MCONTACT hContact, PROTORECVFILE *pre)
{
- CCSDATA ccs = { hContact, PSR_FILE, 0, (LPARAM)pcre };
- return CallService(MS_PROTO_RECVFILET, 0, (LPARAM)&ccs);
+ return Proto_RecvFile(hContact, pre);
}
MEVENT PROTO_INTERFACE::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
|