Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(chatform): crash after opening chat in new window
Browse files Browse the repository at this point in the history
  • Loading branch information
bodwok committed Jul 29, 2019
1 parent 174d6ef commit 59a59fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/widget/contentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/widget/contentdialogmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 59a59fd

Please sign in to comment.