From c13a63cbd48d55d273fae6407044dfc3398eb1da Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 23 Sep 2024 13:42:54 -0400 Subject: [PATCH] use preferredDisplayName and preferredPubKey from proxyRole --- .../AppLayouts/Chat/panels/UserListPanel.qml | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml index 18ac94fcc4..3ce3d801c4 100644 --- a/ui/app/AppLayouts/Chat/panels/UserListPanel.qml +++ b/ui/app/AppLayouts/Chat/panels/UserListPanel.qml @@ -90,14 +90,24 @@ Item { model: SortFilterProxyModel { sourceModel: root.usersModel - proxyRoles: FastExpressionRole { - function displayNameProxy(nickname, ensName, displayName, aliasName) { - return ProfileUtils.displayName(nickname, ensName, displayName, aliasName) + proxyRoles: [ + FastExpressionRole { + function displayNameProxy(nickname, ensName, displayName, aliasName) { + return ProfileUtils.displayName(nickname, ensName, displayName, aliasName) + } + name: "preferredDisplayName" + expectedRoles: ["localNickname", "ensName", "displayName", "alias"] + expression: displayNameProxy(model.localNickname, model.ensName, model.displayName, model.alias) + }, + FastExpressionRole { + function pubKeyProxy(ensVerified, pubKey) { + return ensVerified ? "" : Utils.getCompressedPk(pubKey) + } + name: "preferredPubKey" + expectedRoles: ["ensVerified", "pubKey"] + expression: pubKeyProxy(model.ensVerified, model.pubKey) } - name: "preferredDisplayName" - expectedRoles: ["localNickname", "ensName", "displayName", "alias"] - expression: displayNameProxy(model.localNickname, model.ensName, model.displayName, model.alias) - } + ] sorters: [ RoleSorter { @@ -115,8 +125,8 @@ Item { delegate: StatusMemberListItem { width: ListView.view.width nickName: model.localNickname - userName: ProfileUtils.displayName("", model.ensName, model.displayName, model.alias) - pubKey: model.isEnsVerified ? "" : Utils.getCompressedPk(model.pubKey) + userName: model.preferredDisplayName + pubKey: model.preferredPubKey isContact: model.isContact isVerified: model.isVerified isUntrustworthy: model.isUntrustworthy