summaryrefslogtreecommitdiff
path: root/src/core/stdfile
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-12-04 16:08:03 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-12-04 16:08:03 +0300
commit3bb16e798cb51d5764aacbefd4edf26f52d8c4f0 (patch)
tree59dbb53fc9496d660ec2ef2846a4eab0f1720b88 /src/core/stdfile
parent3216d8df5cb355f34c82ed10b7e40bab7525b697 (diff)
GetContactProto: useless duplicate function replaced with standard Proto_GetBaseAccountName
Diffstat (limited to 'src/core/stdfile')
-rw-r--r--src/core/stdfile/src/file.cpp6
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp4
-rw-r--r--src/core/stdfile/src/filesenddlg.cpp4
-rw-r--r--src/core/stdfile/src/filexferdlg.cpp6
4 files changed, 10 insertions, 10 deletions
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index df862eb0ca..ba4b9d79a4 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -34,7 +34,7 @@ static HGENMENU hSRFileMenuItem;
wchar_t* GetContactID(MCONTACT hContact)
{
- char *szProto = GetContactProto(hContact);
+ char *szProto = Proto_GetBaseAccountName(hContact);
if (db_get_b(hContact, szProto, "ChatRoom", 0) == 1)
if (wchar_t *theValue = db_get_wsa(hContact, szProto, "ChatRoomID"))
return theValue;
@@ -286,7 +286,7 @@ static void RemoveUnreadFileEvents(void)
static int SRFilePreBuildMenu(WPARAM wParam, LPARAM)
{
bool bEnabled = false;
- char *szProto = GetContactProto(wParam);
+ char *szProto = Proto_GetBaseAccountName(wParam);
if (szProto != nullptr) {
bool isChat = db_get_b(wParam, szProto, "ChatRoom", false) != 0;
if (CallProtoService(szProto, PS_GETCAPS, isChat ? PFLAGNUM_4 : PFLAGNUM_1, 0) & (isChat ? PF4_GROUPCHATFILES : PF1_FILESEND)) {
@@ -359,7 +359,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
return 0;
DBEVENTINFO dbei = {};
- dbei.szModule = GetContactProto(ccs->hContact);
+ dbei.szModule = Proto_GetBaseAccountName(ccs->hContact);
dbei.timestamp = pre->timestamp;
dbei.eventType = EVENTTYPE_FILE;
dbei.flags = DBEF_UTF;
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index 6c14b8d406..67a0a8c622 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -140,7 +140,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, B
rvaVarsToReplace[1].key.w = L"userid";
rvaVarsToReplace[1].value.w = GetContactID(hContact);
rvaVarsToReplace[2].key.w = L"proto";
- rvaVarsToReplace[2].value.w = mir_a2u(GetContactProto(hContact));
+ rvaVarsToReplace[2].value.w = mir_a2u(Proto_GetBaseAccountName(hContact));
rvaVarsToReplace[3].key.w = nullptr;
rvaVarsToReplace[3].value.w = nullptr;
for (int i = 0; i < (_countof(rvaVarsToReplace) - 1); i++)
@@ -273,7 +273,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto = GetContactProto(dat->hContact);
+ char *szProto = Proto_GetBaseAccountName(dat->hContact);
if (szProto) {
HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL|PLIF_SMALL, 0);
if (hIcon) {
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp
index 8d68cc335d..78cf440d8a 100644
--- a/src/core/stdfile/src/filesenddlg.cpp
+++ b/src/core/stdfile/src/filesenddlg.cpp
@@ -161,7 +161,7 @@ void __cdecl ChooseFilesThread(void* param)
ofn.nMaxFile = 32767;
ofn.Flags = OFN_NOCHANGEDIR | OFN_FILEMUSTEXIST | OFN_EXPLORER | OFN_HIDEREADONLY | OFN_DONTADDTORECENT;
- char *szProto = GetContactProto(dat->hContact);
+ char *szProto = Proto_GetBaseAccountName(dat->hContact);
if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_SINGLEFILEONLY))
ofn.Flags |= OFN_ALLOWMULTISELECT;
@@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
{
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->hwndItem == GetDlgItem(hwndDlg, IDC_PROTOCOL)) {
- char *szProto = GetContactProto(dat->hContact);
+ char *szProto = Proto_GetBaseAccountName(dat->hContact);
if (szProto) {
HICON hIcon = (HICON)CallProtoService(szProto, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
if (hIcon) {
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp
index adaa06e9cf..d279fbf33e 100644
--- a/src/core/stdfile/src/filexferdlg.cpp
+++ b/src/core/stdfile/src/filexferdlg.cpp
@@ -75,7 +75,7 @@ static void SetOpenFileButtonStyle(HWND hwndButton, int enabled)
void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei)
{
- dbei.szModule = GetContactProto(dat->hContact);
+ dbei.szModule = Proto_GetBaseAccountName(dat->hContact);
dbei.eventType = EVENTTYPE_FILE;
dbei.flags = DBEF_SENT;
dbei.timestamp = time(0);
@@ -271,7 +271,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
dat->hIcon = nullptr;
{
- char *szProto = GetContactProto(dat->hContact);
+ char *szProto = Proto_GetBaseAccountName(dat->hContact);
WORD status = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_ONLINE);
SendDlgItemMessage(hwndDlg, IDC_CONTACT, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadProtoIcon(szProto, status));
}
@@ -457,7 +457,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
PROTOFILERESUME *pfr = (PROTOFILERESUME*)lParam;
wchar_t *szOriginalFilename = (wchar_t*)wParam;
- char *szProto = GetContactProto(dat->hContact);
+ char *szProto = Proto_GetBaseAccountName(dat->hContact);
switch (pfr->action) {
case FILERESUME_CANCEL: