1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(contacts): window with multiple friends contacts

This commit is contained in:
bodwok 2022-03-16 23:45:03 +03:00 committed by Anthony Bilinski
parent 3c467de9f2
commit 1545945236
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C

View File

@ -1359,19 +1359,18 @@ void Widget::openDialog(GenericChatroomWidget* widget, bool newWindow)
widget->updateStatusLight(); widget->updateStatusLight();
GenericChatForm* form; GenericChatForm* form;
GroupId id;
const Friend* frnd = widget->getFriend(); const Friend* frnd = widget->getFriend();
const Group* group = widget->getGroup(); const Group* group = widget->getGroup();
bool chatFormIsSet;
if (frnd) { if (frnd) {
form = chatForms[frnd->getPublicKey()]; form = chatForms[frnd->getPublicKey()];
contentDialogManager->focusChat(frnd->getPersistentId());
chatFormIsSet = contentDialogManager->chatWidgetExists(frnd->getPersistentId());
} else { } else {
id = group->getPersistentId(); form = groupChatForms[group->getPersistentId()].data();
form = groupChatForms[id].data(); contentDialogManager->focusChat(group->getPersistentId());
chatFormIsSet = contentDialogManager->chatWidgetExists(group->getPersistentId());
} }
bool chatFormIsSet;
contentDialogManager->focusChat(id);
chatFormIsSet = contentDialogManager->chatWidgetExists(id);
if ((chatFormIsSet || form->isVisible()) && !newWindow) { if ((chatFormIsSet || form->isVisible()) && !newWindow) {
return; return;