diff --git a/src/widget/contentdialog.cpp b/src/widget/contentdialog.cpp index da34e9e30..bf9f92f0c 100644 --- a/src/widget/contentdialog.cpp +++ b/src/widget/contentdialog.cpp @@ -155,7 +155,7 @@ FriendWidget* ContentDialog::addFriend(std::shared_ptr 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 chatroom, GroupWidget* ContentDialog::addGroup(std::shared_ptr 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; diff --git a/src/widget/contentdialogmanager.cpp b/src/widget/contentdialogmanager.cpp index c6546767c..d79334642 100644 --- a/src/widget/contentdialogmanager.cpp +++ b/src/widget/contentdialogmanager.cpp @@ -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) {