From 56fdabecb8a871532a30e6e403d5108e80586bf0 Mon Sep 17 00:00:00 2001
From: George Hazan <ghazan@miranda.im>
Date: Wed, 6 Feb 2019 20:56:51 +0300
Subject: fixes #1826 (TabSRMM: if a contact was added from clist, appropriate
 controls in tabSRMM window remains active)

---
 plugins/TabSRMM/src/globals.cpp   | 6 ++++++
 plugins/TabSRMM/src/msgdialog.cpp | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

(limited to 'plugins/TabSRMM/src')

diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 05f1f8dc86..32e130295d 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -391,10 +391,16 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam)
 		CTabBaseDlg *dat = c->getDat();
 		if (!strcmp(setting, "MirVer"))
 			PostMessage(hwnd, DM_CLIENTCHANGED, 0, 0);
+
+		if (dat && !strcmp(setting, "NotOnList") && (cws->value.type == DBVT_DELETED || cws->value.bVal == 0))
+			((CSrmmWindow*)dat)->onClick_CancelAdd(0);
+		
 		if (dat && (fChanged || fExtendedStatusChange))
 			dat->UpdateTitle();
+
 		if (fExtendedStatusChange)
 			PostMessage(hwnd, DM_UPDATESTATUSMSG, 0, 0);
+
 		if (fChanged) {
 			if (dat && c->getStatus() == ID_STATUS_OFFLINE) {			// clear typing notification in the status bar when contact goes offline
 				dat->m_nTypeSecs = 0;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index bc7451bfbb..625dbe7f8a 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -1159,7 +1159,7 @@ void CSrmmWindow::onClick_Add(CCtrlButton*)
 	Contact_Add(m_hContact, m_hwnd);
 
 	if (!db_get_b(m_hContact, "CList", "NotOnList", 0)) {
-		m_bNotOnList = FALSE;
+		m_bNotOnList = false;
 		ShowMultipleControls(m_hwnd, addControls, _countof(addControls), SW_HIDE);
 		if (!(m_dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
 			Utils::showDlgControl(m_hwnd, IDC_LOGFROZENTEXT, SW_HIDE);
@@ -1257,7 +1257,7 @@ void CSrmmWindow::onClick_Quote(CCtrlButton*)
 
 void CSrmmWindow::onClick_CancelAdd(CCtrlButton*)
 {
-	m_bNotOnList = FALSE;
+	m_bNotOnList = false;
 	ShowMultipleControls(m_hwnd, addControls, _countof(addControls), SW_HIDE);
 	if (!(m_dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
 		Utils::showDlgControl(m_hwnd, IDC_LOGFROZENTEXT, SW_HIDE);
-- 
cgit v1.2.3