diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-14 12:39:09 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-14 12:39:09 +0300 |
commit | 9452547a27bc4dfd19653ace992e33f764f565a7 (patch) | |
tree | ed685fb0805879286afae60a17e199103566dcc5 /plugins/TabSRMM | |
parent | a5f0d0cde8b48159d1616aa9f6b0b0f77fd773d0 (diff) |
fixes #3156 (TabSRMM: warning dialog)
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.cpp | 11 |
2 files changed, 9 insertions, 5 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index c720434072..2d54f9a3d6 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -695,6 +695,9 @@ int LoadSendRecvMessageModule(void) db_delete_module(0, NEN_OLD_MODULE);
}
+ if (M.GetDword("cWarningsV", 0) == 0)
+ db_set_dw(0, SRMSGMOD_T, "cWarningsV", M.GetDword("cWarningsL", 0));
+
HookEvent(ME_OPT_INITIALISE, OptInitialise);
InitAPI();
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index be370dfaf8..db0f20b3a6 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -680,7 +680,7 @@ LRESULT CWarning::show(const int uId, uint32_t dwFlags, const wchar_t* tszTxt) uint32_t val = M.GetDword("cWarningsL", 0);
uint32_t mask = ((__int64)1L) << uId;
if (mask & val) {
- bool bResult = (M.GetDword("cWarningsV", 0xFFFFFFFF) & mask) != 0;
+ bool bResult = (M.GetDword("cWarningsV", 0) & mask) != 0;
if (dwFlags & MB_YESNO || dwFlags & MB_YESNOCANCEL)
return (bResult) ? IDYES : IDNO;
return IDOK;
@@ -820,10 +820,11 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP if (::IsDlgButtonChecked(hwnd, IDC_DONTSHOWAGAIN)) {
uint32_t newVal = M.GetDword("cWarningsL", 0) | ((uint32_t)1L << m_uId);
db_set_dw(0, SRMSGMOD_T, "cWarningsL", newVal);
- }
- if (LOWORD(wParam) != IDNO) {
- uint32_t newVal = M.GetDword("cWarningsV", 0) | ((uint32_t)1L << m_uId);
- db_set_dw(0, SRMSGMOD_T, "cWarningsV", newVal);
+
+ if (LOWORD(wParam) != IDNO) {
+ newVal = M.GetDword("cWarningsV", 0) | ((uint32_t)1L << m_uId);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsV", newVal);
+ }
}
__fallthrough;
|