From bebacab622a24452c281d21188f2190ef6733c31 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 31 Mar 2017 22:44:20 +0300 Subject: minor code cleaning --- plugins/Scriver/src/chat_window.cpp | 15 +++++++++------ plugins/Scriver/src/tabs.cpp | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 596828869b..02ce2d60ab 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -1117,19 +1117,22 @@ void ShowRoom(SESSION_INFO *si) return; // Do we need to create a window? + CChatRoomDlg *pDlg; if (si->pDlg == nullptr) { HWND hParent = GetParentWindow(si->hContact, TRUE); - CChatRoomDlg *pDlg = new CChatRoomDlg(si); + pDlg = new CChatRoomDlg(si); pDlg->SetParent(hParent); pDlg->Show(); pDlg->m_pParent = (ParentWindowData*)GetWindowLongPtr(hParent, GWLP_USERDATA); si->pDlg = pDlg; } - SendMessage(si->pDlg->GetHwnd(), DM_UPDATETABCONTROL, -1, (LPARAM)si); - SendMessage(GetParent(si->pDlg->GetHwnd()), CM_ACTIVATECHILD, 0, (LPARAM)si->pDlg->GetHwnd()); - SendMessage(GetParent(si->pDlg->GetHwnd()), CM_POPUPWINDOW, 0, (LPARAM)si->pDlg->GetHwnd()); - SendMessage(si->pDlg->GetHwnd(), WM_MOUSEACTIVATE, 0, 0); - SetFocus(GetDlgItem(si->pDlg->GetHwnd(), IDC_SRMM_MESSAGE)); + else pDlg = si->pDlg; + + SendMessage(pDlg->GetHwnd(), DM_UPDATETABCONTROL, -1, (LPARAM)si); + SendMessage(GetParent(pDlg->GetHwnd()), CM_ACTIVATECHILD, 0, (LPARAM)pDlg->GetHwnd()); + SendMessage(GetParent(pDlg->GetHwnd()), CM_POPUPWINDOW, 0, (LPARAM)pDlg->GetHwnd()); + SendMessage(pDlg->GetHwnd(), WM_MOUSEACTIVATE, 0, 0); + SetFocus(GetDlgItem(pDlg->GetHwnd(), IDC_SRMM_MESSAGE)); } diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp index 7dbc4f7c91..b01fa4b507 100644 --- a/plugins/Scriver/src/tabs.cpp +++ b/plugins/Scriver/src/tabs.cpp @@ -1407,12 +1407,12 @@ HWND GetParentWindow(MCONTACT hContact, BOOL bChat) else { if (g_dat.lastChatParent != nullptr) { int tabsNum = (int)SendMessage(g_dat.lastChatParent->hwnd, CM_GETCHILDCOUNT, 0, 0); - if (!(g_dat.flags2 & SMF2_LIMITCHATSTABS) || tabsNum < g_dat.limitChatsTabsNum) { + if (!(g_dat.flags2 & SMF2_LIMITCHATSTABS) || tabsNum < g_dat.limitChatsTabsNum) return g_dat.lastChatParent->hwnd; - } } } } + if (!(g_dat.flags2 & SMF2_SEPARATECHATSCONTAINERS)) newData.isChat = FALSE; -- cgit v1.2.3