Fixed the issue doesn't show nickname on profileview in 1:1 chat. Fixes #1826

This commit is contained in:
ace-smart 2021-02-11 12:39:46 +04:00 committed by Jonathan Rainville
parent 7b5a1660f8
commit 972cf9f138
2 changed files with 12 additions and 1 deletions

View File

@ -64,6 +64,17 @@ QtObject:
QtProperty[string] name:
read = name
notify = contactsUpdated
proc nickname*(self: ChatItemView): string {.slot.} =
if self.chatItem != nil and self.chatItem.chatType.isOneToOne:
if self.status.chat.contacts.hasKey(self.chatItem.id) and self.status.chat.contacts[self.chatItem.id].hasNickname():
return self.status.chat.contacts[self.chatItem.id].localNickname
else:
result = ""
QtProperty[string] nickname:
read = nickname
notify = contactsUpdated
proc ensVerified*(self: ChatItemView): bool {.slot.} =
if self.chatItem != nil and

View File

@ -42,7 +42,7 @@ Rectangle {
break;
case Constants.chatTypeOneToOne:
const profileImage = appMain.getProfileImage(chatsModel.activeChannel.id)
openProfilePopup(chatsModel.activeChannel.name, chatsModel.activeChannel.id, profileImage || chatsModel.activeChannel.identicon)
openProfilePopup(chatsModel.activeChannel.name, chatsModel.activeChannel.id, profileImage || chatsModel.activeChannel.identicon, "", chatsModel.activeChannel.nickname)
break;
}
}