From 500dd4848842f6d4207584417448586d060fbd6a Mon Sep 17 00:00:00 2001 From: George Hazan <ghazan@miranda.im> Date: Sun, 31 Jul 2022 18:07:27 +0300 Subject: Contact: group of functions gathered into the personal namespace --- src/core/stdfile/src/file.cpp | 8 ++++---- src/core/stdfile/src/filerecvdlg.cpp | 10 +++++----- src/core/stdfile/src/filesenddlg.cpp | 2 +- src/core/stdfile/src/filexferdlg.cpp | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/core/stdfile') diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 39e24e7c50..8dcb922619 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -35,11 +35,11 @@ static HGENMENU hSRFileMenuItem; wchar_t* GetContactID(MCONTACT hContact) { char *szProto = Proto_GetBaseAccountName(hContact); - if (Contact_IsGroupChat(hContact, szProto)) + if (Contact::IsGroupChat(hContact, szProto)) if (wchar_t *theValue = db_get_wsa(hContact, szProto, "ChatRoomID")) return theValue; - return Contact_GetInfo(CNF_UNIQUEID, hContact, szProto); + return Contact::GetInfo(CNF_UNIQUEID, hContact, szProto); } static INT_PTR SendFileCommand(WPARAM hContact, LPARAM) @@ -101,7 +101,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) cle.hContact = hContact; cle.hDbEvent = hdbe; cle.lParam = lParam; - if (g_plugin.bAutoAccept && Contact_OnList(hContact)) { + if (g_plugin.bAutoAccept && Contact::OnList(hContact)) { CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FILERECV), NULL, DlgProcRecvFile, (LPARAM)&cle); } else { @@ -288,7 +288,7 @@ static int SRFilePreBuildMenu(WPARAM wParam, LPARAM) bool bEnabled = false; char *szProto = Proto_GetBaseAccountName(wParam); if (szProto != nullptr) { - bool isChat = Contact_IsGroupChat(wParam, szProto); + bool isChat = Contact::IsGroupChat(wParam, szProto); if (CallProtoService(szProto, PS_GETCAPS, isChat ? PFLAGNUM_4 : PFLAGNUM_1, 0) & (isChat ? PF4_GROUPCHATFILES : PF1_FILESEND)) { if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_OFFLINEFILES) bEnabled = true; diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 651ae2746a..54aefe44c5 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -244,10 +244,10 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l TimeZone_PrintTimeStamp(NULL, dbei.timestamp, L"t d", datetimestr, _countof(datetimestr), 0); SetDlgItemText(hwndDlg, IDC_DATE, datetimestr); - ptrW info(Contact_GetInfo(CNF_UNIQUEID, dat->hContact)); + ptrW info(Contact::GetInfo(CNF_UNIQUEID, dat->hContact)); SetDlgItemText(hwndDlg, IDC_NAME, (info) ? info : contactName); - if (!Contact_OnList(dat->hContact)) { + if (!Contact::OnList(dat->hContact)) { RECT rcBtn1, rcBtn2, rcDateCtrl; GetWindowRect(GetDlgItem(hwndDlg, IDC_ADD), &rcBtn1); GetWindowRect(GetDlgItem(hwndDlg, IDC_USERMENU), &rcBtn2); @@ -258,7 +258,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l //don't check auto-min here to fix BUG#647620 PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDOK, BN_CLICKED), (LPARAM)GetDlgItem(hwndDlg, IDOK)); } - if (Contact_OnList(dat->hContact)) + if (Contact::OnList(dat->hContact)) ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE); } return TRUE; @@ -343,9 +343,9 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l break; case IDC_ADD: - Contact_Add(dat->hContact, hwndDlg); + Contact::Add(dat->hContact, hwndDlg); - if (Contact_OnList(dat->hContact)) + if (Contact::OnList(dat->hContact)) ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE); break; diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index 30f6fa84b8..017725e89d 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -238,7 +238,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l wchar_t *contactName = Clist_GetContactDisplayName(dat->hContact); SetDlgItemText(hwndDlg, IDC_TO, contactName); - ptrW id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact)); + ptrW id(Contact::GetInfo(CNF_UNIQUEID, dat->hContact)); SetDlgItemText(hwndDlg, IDC_NAME, (id) ? id : contactName); if (fsd->ppFiles == nullptr) { diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 81f849acbb..bcd6c16c54 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -260,7 +260,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR CreateDirectoryTreeW(dat->szSavePath); dat->fs = (HANDLE)ProtoChainSend(dat->hContact, PSS_FILEALLOW, (WPARAM)dat->fs, (LPARAM)dat->szSavePath); dat->transferStatus.szWorkingDir.w = mir_wstrdup(dat->szSavePath); - if (!Contact_OnList(dat->hContact)) + if (!Contact::OnList(dat->hContact)) dat->resumeBehaviour = FILERESUME_ASK; else dat->resumeBehaviour = g_plugin.getByte("IfExists", FILERESUME_ASK); -- cgit v1.2.3