Browse Source

fix(contacts): window with multiple friends contacts

reviewable/pr6576/r1
bodwok 4 years ago
parent
commit
aa28b5dffb
No known key found for this signature in database
GPG Key ID: A279D059178DA7BA
  1. 14
      src/widget/widget.cpp

14
src/widget/widget.cpp

@ -1382,19 +1382,19 @@ void Widget::openDialog(GenericChatroomWidget* widget, bool newWindow) @@ -1382,19 +1382,19 @@ void Widget::openDialog(GenericChatroomWidget* widget, bool newWindow)
widget->updateStatusLight();
GenericChatForm* form;
GroupId id;
const Friend* frnd = widget->getFriend();
const Group* group = widget->getGroup();
auto contentDialogManager = ContentDialogManager::getInstance();
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::getInstance()->focusChat(id);
chatFormIsSet = ContentDialogManager::getInstance()->chatWidgetExists(id);
if ((chatFormIsSet || form->isVisible()) && !newWindow) {
return;

Loading…
Cancel
Save