summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-09-27 23:43:06 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-09-27 23:43:06 +0300
commite441a31e9f912fc8e9244d16560565559b1924d2 (patch)
treee9d47703f0e56bb5745e7e4e842d14ce989fe86d /src/core
parent91811190c158e4ff97cc94ef93415c12ddf738ed (diff)
end of manual experiments with CList/NotOnList
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdfile/src/file.cpp2
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp6
-rw-r--r--src/core/stdfile/src/filexferdlg.cpp6
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp8
4 files changed, 12 insertions, 10 deletions
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index cd106fedba..df862eb0ca 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -101,7 +101,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam)
cle.hContact = hContact;
cle.hDbEvent = hdbe;
cle.lParam = lParam;
- if (g_plugin.getByte("AutoAccept", 0) && !db_get_b(hContact, "CList", "NotOnList", 0)) {
+ if (g_plugin.getByte("AutoAccept", 0) && Contact_OnList(hContact)) {
CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FILERECV), NULL, DlgProcRecvFile, (LPARAM)&cle);
}
else {
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index 2fe57e4935..6c14b8d406 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -250,7 +250,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
ptrW info(Contact_GetInfo(CNF_UNIQUEID, dat->hContact));
SetDlgItemText(hwndDlg, IDC_NAME, (info) ? info : contactName);
- if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) {
+ if (!Contact_OnList(dat->hContact)) {
RECT rcBtn1, rcBtn2, rcDateCtrl;
GetWindowRect(GetDlgItem(hwndDlg, IDC_ADD), &rcBtn1);
GetWindowRect(GetDlgItem(hwndDlg, IDC_USERMENU), &rcBtn2);
@@ -261,7 +261,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 (!db_get_b(dat->hContact, "CList", "NotOnList", 0))
+ if (Contact_OnList(dat->hContact))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
}
return TRUE;
@@ -348,7 +348,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case IDC_ADD:
Contact_Add(dat->hContact, hwndDlg);
- if (!db_get_b(dat->hContact, "CList", "NotOnList", 0))
+ if (Contact_OnList(dat->hContact))
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), SW_HIDE);
break;
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp
index 9f8bc128f8..adaa06e9cf 100644
--- a/src/core/stdfile/src/filexferdlg.cpp
+++ b/src/core/stdfile/src/filexferdlg.cpp
@@ -245,8 +245,10 @@ 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 (db_get_b(dat->hContact, "CList", "NotOnList", 0)) dat->resumeBehaviour = FILERESUME_ASK;
- else dat->resumeBehaviour = g_plugin.getByte("IfExists", FILERESUME_ASK);
+ if (!Contact_OnList(dat->hContact))
+ dat->resumeBehaviour = FILERESUME_ASK;
+ else
+ dat->resumeBehaviour = g_plugin.getByte("IfExists", FILERESUME_ASK);
SetFtStatus(hwndDlg, LPGENW("Waiting for connection..."), FTS_TEXT);
}
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index f5e3c146c3..d1e6bfdb9c 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -336,7 +336,7 @@ void CMsgDialog::OnDestroy()
// a temporary contact should be destroyed after removing window from the window list to prevent recursion
if (m_hContact && g_dat.bDeleteTempCont)
- if (db_get_b(m_hContact, "CList", "NotOnList", 0))
+ if (!Contact_OnList(m_hContact))
db_delete_contact(m_hContact);
}
@@ -878,7 +878,7 @@ INT_PTR CMsgDialog::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case IDC_ADD:
Contact_Add(m_hContact, m_hwnd);
- if (!db_get_b(m_hContact, "CList", "NotOnList", 0))
+ if (Contact_OnList(m_hContact))
ShowWindow(GetDlgItem(m_hwnd, IDC_ADD), FALSE);
break;
}
@@ -1472,7 +1472,7 @@ void CMsgDialog::OnOptionsApplied(bool bUpdateAvatar)
bool bShow = false;
if (m_hContact && g_dat.bShowButtons) {
if (cbd->m_dwButtonCID == IDC_ADD) {
- bShow = 0 != db_get_b(m_hContact, "CList", "NotOnList", 0);
+ bShow = !Contact_OnList(m_hContact);
cbd->m_bHidden = !bShow;
}
else bShow = true;
@@ -1611,7 +1611,7 @@ void CMsgDialog::NotifyTyping(int mode)
if (protoCaps & PF1_INVISLIST && protoStatus == ID_STATUS_INVISIBLE && db_get_w(m_hContact, m_szProto, "ApparentMode", 0) != ID_STATUS_ONLINE)
return;
- if (!g_dat.bTypingUnknown && db_get_b(m_hContact, "CList", "NotOnList", 0))
+ if (!g_dat.bTypingUnknown && !Contact_OnList(m_hContact))
return;
// End user check