diff --git a/src/app/chat/view.nim b/src/app/chat/view.nim index 42ebef3e4c..786d347b8f 100644 --- a/src/app/chat/view.nim +++ b/src/app/chat/view.nim @@ -224,3 +224,7 @@ QtObject: proc makeAdmin*(self: ChatsView, chatId: string, pubKey: string) {.slot.} = self.status.chat.makeAdmin(chatId, pubKey) + + proc isEnsVerified*(self: ChatsView, id: string): bool {.slot.} = + if id == "": return false + self.status.contacts.getContactByID(id).ensVerified diff --git a/src/app/chat/views/message_list.nim b/src/app/chat/views/message_list.nim index 349fcfcab8..b9727d86e6 100644 --- a/src/app/chat/views/message_list.nim +++ b/src/app/chat/views/message_list.nim @@ -86,7 +86,6 @@ QtObject: ChatMessageRoles.ChatId.int:"chatId", ChatMessageRoles.SectionIdentifier.int: "sectionIdentifier", ChatMessageRoles.Id.int: "messageId" - }.toTable proc add*(self: ChatMessageList, message: Message) = diff --git a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml index 62045daf9d..96bd9e7705 100644 --- a/ui/app/AppLayouts/Chat/components/ProfilePopup.qml +++ b/ui/app/AppLayouts/Chat/components/ProfilePopup.qml @@ -11,12 +11,14 @@ ModalPopup { property var userName: "" property var fromAuthor: "" property bool showQR: false + property bool isEnsVerified: false function openPopup(userNameParam, fromAuthorParam, identiconParam) { this.showQR = false this.userName = userNameParam this.fromAuthor = fromAuthorParam this.identicon = identiconParam + this.isEnsVerified = chatsModel.isEnsVerified(this.fromAuthor) popup.open() } @@ -123,6 +125,8 @@ ModalPopup { StyledText { id: labelEnsUsername + height: isEnsVerified ? 20 : 0 + visible: isEnsVerified text: qsTr("ENS username") font.pixelSize: 13 font.weight: Font.Medium @@ -135,7 +139,9 @@ ModalPopup { StyledText { id: valueEnsName - text: "@emily.stateofus.eth" + visible: isEnsVerified + height: isEnsVerified ? 20 : 0 + text: userName font.pixelSize: 14 anchors.left: parent.left anchors.leftMargin: Theme.smallPadding @@ -144,6 +150,8 @@ ModalPopup { } CopyToClipBoardIcon { + visible: isEnsVerified + height: isEnsVerified ? 20 : 0 anchors.top: labelEnsUsername.bottom anchors.left: valueEnsName.right anchors.leftMargin: Theme.smallPadding @@ -160,7 +168,7 @@ ModalPopup { color: Theme.darkGrey anchors.left: parent.left anchors.leftMargin: Theme.smallPadding - anchors.top: valueEnsName.bottom + anchors.top: isEnsVerified ? valueEnsName.bottom : parent.top anchors.topMargin: Theme.padding }