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

Merge pull request #6576

bodwok (1):
      fix(contacts): window with multiple friends contacts
This commit is contained in:
Anthony Bilinski 2022-05-08 05:27:10 -07:00
commit bc8763e835
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;