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

Merge pull request #5753

bodwok (1):
      fix(chatform): crash after opening chat in new window
This commit is contained in:
Anthony Bilinski 2019-07-30 13:25:44 -07:00
commit 3a0891eadf
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
2 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ FriendWidget* ContentDialog::addFriend(std::shared_ptr<FriendChatroom> chatroom,
{
const auto compact = Settings::getInstance().getCompactLayout();
auto frnd = chatroom->getFriend();
auto friendPk = frnd->getPublicKey();
const auto& friendPk = frnd->getPublicKey();
auto friendWidget = new FriendWidget(chatroom, compact);
emit connectFriendWidget(*friendWidget);
contactWidgets[friendPk] = friendWidget;
@ -176,7 +176,7 @@ FriendWidget* ContentDialog::addFriend(std::shared_ptr<FriendChatroom> chatroom,
GroupWidget* ContentDialog::addGroup(std::shared_ptr<GroupChatroom> chatroom, GenericChatForm* form)
{
const auto g = chatroom->getGroup();
const auto groupId = g->getPersistentId();
const auto& groupId = g->getPersistentId();
const auto compact = Settings::getInstance().getCompactLayout();
auto groupWidget = new GroupWidget(chatroom, compact);
contactWidgets[groupId] = groupWidget;

View File

@ -63,7 +63,7 @@ FriendWidget* ContentDialogManager::addFriendToDialog(ContentDialog* dialog,
GenericChatForm* form)
{
auto friendWidget = dialog->addFriend(chatroom, form);
const auto friendPk = friendWidget->getFriend()->getPublicKey();
const auto& friendPk = friendWidget->getFriend()->getPublicKey();
ContentDialog* lastDialog = getFriendDialog(friendPk);
if (lastDialog) {