From 4a13d085551a16c2d0464ae7e0709b7cd583c164 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 21 Sep 2024 19:30:47 +0300 Subject: tabSRMM: fix for dbl click on group chats + minor code cleaning --- plugins/TabSRMM/src/container.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index abec648c45..0eafde8a99 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -2294,10 +2294,7 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd) CMsgDialog* TSAPI AutoCreateWindow(TContainerData *pContainer, MCONTACT hContact, bool bActivate) { - wchar_t szName[CONTAINER_NAMELEN + 1]; - GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN); - - bool bAllowAutoCreate = false; + bool bAllowAutoCreate = false, bForceCreate = g_plugin.bAutoPopup || bActivate; uint32_t dwStatusMask = M.GetDword("autopopupmask", -1); if (dwStatusMask == -1) @@ -2314,11 +2311,14 @@ CMsgDialog* TSAPI AutoCreateWindow(TContainerData *pContainer, MCONTACT hContact } } - if (bAllowAutoCreate && (g_plugin.bAutoPopup || g_plugin.bAutoTabs)) { + if (bAllowAutoCreate && (bForceCreate || g_plugin.bAutoTabs)) { + wchar_t szName[CONTAINER_NAMELEN + 1]; + GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN); + if (pContainer == nullptr) pContainer = FindContainerByName(szName); - if (g_plugin.bAutoPopup) { + if (bForceCreate) { if (pContainer == nullptr) pContainer = CreateContainer(szName, 0, hContact); return CreateNewTabForContact(pContainer, hContact, true, true); -- cgit v1.2.3