fix(ActivityNotificationMessage): use ProfileUtils.displayName()

to compose the primary/secondary user names, just like we do in the
message views, or the Profile dialog
This commit is contained in:
Lukáš Tinkl 2023-04-19 18:31:26 +02:00 committed by Lukáš Tinkl
parent 297b73fced
commit c209e7c282
2 changed files with 8 additions and 4 deletions

View File

@ -89,9 +89,9 @@ Item {
Loader {
id: secondaryDisplayNameLoader
active: !root.amISender && !!root.sender.secondaryName
visible: active
asynchronous: true
sourceComponent: StatusBaseText {
id: secondaryDisplayName
verticalAlignment: Text.AlignVCenter
color: Theme.palette.baseColor1
font.pixelSize: Theme.asideTextFontSize

View File

@ -24,9 +24,13 @@ ActivityNotificationBase {
messageText: notification ? notification.message.messageText : ""
amISender: false
sender.id: contactId
sender.displayName: contactDetails ? contactDetails.displayName : ""
sender.secondaryName: contactDetails ? contactDetails.localNickname : ""
sender.displayName: contactDetails ? ProfileUtils.displayName(contactDetails.localNickname, contactDetails.ensVerified ? contactDetails.name : "",
contactDetails.displayName, contactDetails.alias) : ""
sender.secondaryName: contactDetails && contactDetails.localNickname ? ProfileUtils.displayName("", contactDetails.ensVerified ? contactDetails.name : "",
contactDetails.displayName, contactDetails.alias) : ""
sender.trustIndicator: contactDetails ? contactDetails.trustStatus : Constants.trustStatus.unknown
sender.isEnsVerified: !!contactDetails && contactDetails.ensVerified
sender.isContact: !!contactDetails && contactDetails.isContact
sender.profileImage {
width: 40
height: 40
@ -34,7 +38,7 @@ ActivityNotificationBase {
assetSettings.isImage: contactDetails && contactDetails.displayIcon.startsWith("data")
pubkey: contactId
colorId: Utils.colorIdForPubkey(contactId)
colorHash: Utils.getColorHashAsJson(contactId, contactDetails && contactDetails.ensVerified)
colorHash: Utils.getColorHashAsJson(contactId, sender.isEnsVerified)
}
}