From 1545945236681bb1561df9bf2e8cafd701b3699a Mon Sep 17 00:00:00 2001 From: bodwok Date: Wed, 16 Mar 2022 23:45:03 +0300 Subject: [PATCH] fix(contacts): window with multiple friends contacts --- src/widget/widget.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 5cfcea5bc..da71693bc 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -1359,19 +1359,18 @@ void Widget::openDialog(GenericChatroomWidget* widget, bool newWindow) widget->updateStatusLight(); GenericChatForm* form; - GroupId id; const Friend* frnd = widget->getFriend(); const Group* group = widget->getGroup(); + bool chatFormIsSet; if (frnd) { form = chatForms[frnd->getPublicKey()]; + contentDialogManager->focusChat(frnd->getPersistentId()); + chatFormIsSet = contentDialogManager->chatWidgetExists(frnd->getPersistentId()); } else { - id = group->getPersistentId(); - form = groupChatForms[id].data(); + form = groupChatForms[group->getPersistentId()].data(); + contentDialogManager->focusChat(group->getPersistentId()); + chatFormIsSet = contentDialogManager->chatWidgetExists(group->getPersistentId()); } - bool chatFormIsSet; - contentDialogManager->focusChat(id); - chatFormIsSet = contentDialogManager->chatWidgetExists(id); - if ((chatFormIsSet || form->isVisible()) && !newWindow) { return;