fix(@desktop/chat): Fix showing contact names after restoring account

Fixes #7241
This commit is contained in:
Michal Iskierko 2022-09-08 12:28:22 +02:00 committed by Michał Iskierko
parent 0f1ade6967
commit a45770cc98
2 changed files with 3 additions and 4 deletions

View File

@ -75,7 +75,7 @@ method onNewMessagesLoaded*(self: Module, messages: seq[MessageDto]) =
let status = toOnlineStatus(statusUpdateDto.statusType)
self.view.model().addItem(initMemberItem(
pubKey = m.`from`,
displayName = contactDetails.details.displayName,
displayName = contactDetails.displayName,
ensName = contactDetails.details.name, # is it correct?
localNickname = contactDetails.details.localNickname,
alias = contactDetails.details.alias,
@ -133,7 +133,6 @@ method addChatMember*(self: Module, member: ChatMember) =
let isMe = member.id == singletonInstance.userProfile.getPubKey()
let contactDetails = self.controller.getContactDetails(member.id)
var status = OnlineStatus.Online
var displayName = contactDetails.details.displayName
if (isMe):
let currentUserStatus = intToEnum(singletonInstance.userProfile.getCurrentUserStatus(), StatusType.Unknown)
status = toOnlineStatus(currentUserStatus)
@ -143,7 +142,7 @@ method addChatMember*(self: Module, member: ChatMember) =
self.view.model().addItem(initMemberItem(
pubKey = member.id,
displayName = contactDetails.details.displayName,
displayName = contactDetails.displayName,
ensName = contactDetails.details.name,
localNickname = contactDetails.details.localNickname,
alias = contactDetails.details.alias,

View File

@ -102,7 +102,7 @@ Item {
messageContextMenu.myPublicKey = userProfile.pubKey
messageContextMenu.selectedUserPublicKey = model.pubKey
messageContextMenu.selectedUserDisplayName = model.displayName
messageContextMenu.selectedUserIcon = asset.source
messageContextMenu.selectedUserIcon = model.icon
messageContextMenu.popup(4, 4)
} else if (mouse.button === Qt.LeftButton && !!messageContextMenu) {
Global.openProfilePopup(model.pubKey);