diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-31 22:44:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-31 22:49:22 +0300 |
commit | bebacab622a24452c281d21188f2190ef6733c31 (patch) | |
tree | 6c3a3d9fe18d50668b635eb5490b4ce2e59b8631 /plugins | |
parent | 969e3f67c473c0775512f16a54b677d2430fa2b8 (diff) |
minor code cleaning
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Scriver/src/chat_window.cpp | 15 | ||||
-rw-r--r-- | plugins/Scriver/src/tabs.cpp | 4 |
2 files changed, 11 insertions, 8 deletions
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;
|