fix(StatusMessageSenderDetails): Simplify StatusMessageSenderDetails

StatusMessageSenderDetails contains only displayName and secondaryName.
Correct values are delivered by a model.

Issue #7241
This commit is contained in:
Michal Iskierko 2022-09-14 09:27:01 +02:00 committed by Michał Iskierko
parent 7d96b2d4c1
commit a94d9338bf
6 changed files with 53 additions and 87 deletions

View File

@ -40,9 +40,8 @@ ListView {
messageContent: model.messageContent
amISender: model.amIsender
sender.id: model.senderId
sender.userName: model.userName
sender.localName: model.localName
sender.ensName: model.ensName
sender.displayName: model.senderDisplayName
sender.secondaryName: model.senderOptionalName
sender.isContact: model.isContact
sender.trustIndicator: model.trustIndicator
sender.profileImage: StatusProfileImageSettings {
@ -68,8 +67,8 @@ ListView {
replyDetails: StatusMessageDetails {
amISender: model.isReply && model.replyAmISender
sender.id: model.replySenderId || ""
sender.userName: model.isReply ? model.replySenderName: ""
sender.ensName: model.isReply ? model.replySenderEnsName : ""
sender.displayName: model.isReply ? model.replySenderName: ""
sender.secondaryName: model.isReply ? model.replySenderEnsName : ""
sender.profileImage: StatusProfileImageSettings {
width: 20
height: 20

View File

@ -437,9 +437,8 @@ QtObject {
timestamp: "1656937930"
amIsender: false
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
userName: "Ferocious Herringbone Sinewave"
ensName: ""
localName: ""
senderDisplayName: "Ferocious Herringbone Sinewave"
senderOptionalName: ""
profileImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAlklEQVR4nOzW0QmDQBAG4SSkl7SUQlJGCrElq9F3QdjjVhh/5nv3cFhY9vUIYQiNITSG0BhCExPynn1gWf9bx498P7/
nzPcxEzGExhBdJGYihtAYQlO+tUZvqrPbqeudo5iJGEJjCE15a3VtodH3q2ImYgiNITTlTdG1nUZ5a92VITQxITFiJmIIjSE0htAYQrMHAAD//+wwFVpz+yqXAAAAAElFTkSuQmCC"
contentType: StatusMessage.ContentType.Text
@ -465,9 +464,8 @@ QtObject {
timestamp: "1657937930"
amIsender: false
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
userName: "Teenage Mutant Turtle"
ensName: ""
localName: ""
senderDisplayName: "Teenage Mutant Turtle"
senderOptionalName: ""
profileImage: ""
contentType: StatusMessage.ContentType.Text
message: 'Simple text message'
@ -492,9 +490,8 @@ QtObject {
timestamp: "1657937930"
amIsender: false
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
userName: "Teenage Mutant Turtle"
ensName: ""
localName: "Bro from work"
senderDisplayName: "Bro from work"
senderOptionalName: "Teenage Mutant Turtle"
profileImage: ""
contentType: StatusMessage.ContentType.Text
message: '<code>Renamed, contact</code>'
@ -519,9 +516,8 @@ QtObject {
timestamp: "1657937930"
amIsender: false
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
userName: "Teenage Mutant Turtle"
ensName: "@turtle.statusofus.eth"
localName: "Bro from work"
senderOptionalName: "@turtle.statusofus.eth"
senderDisplayName: "Bro from work"
profileImage: ""
contentType: StatusMessage.ContentType.Text
message: '<code>ENS, Renamed, Contact, Untrustworthy</code>'
@ -546,9 +542,8 @@ QtObject {
timestamp: "1658937930"
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
amIsender: false
userName: "Teenage Mutant Turtle"
ensName: "@turtle.statusofus.eth"
localName: "Bro from work"
senderOptionalName: "@turtle.statusofus.eth"
senderDisplayName: "Bro from work"
profileImage: ""
message: '<code>ENS, renamed, contact, verified</code>'
contentType: StatusMessage.ContentType.Text
@ -573,9 +568,8 @@ QtObject {
timestamp: "1658937930"
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
amIsender: false
userName: "Teenage Mutant Turtle"
ensName: ""
localName: "Bro from work"
senderOptionalName: "Teenage Mutant Turtle"
senderDisplayName: "Bro from work"
profileImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiElEQVR4nOzXUQpAQBRGYWQvLNAyLJDV8C5qpiGnv/M9al5Ot27X0IUwhMYQGkNoDKGJCRlLH67bftx9X+ap/+P9VcxEDKExhKZ4a9Uq3TZviZmIITSG0DRvlqcbqVbrlouZiCE0htD4h0hjCI0hNN5aNIbQGKKPxEzEEBpDaAyhMYTmDAAA//+gYCErzmCpCQAAAABJRU5ErkJggg="
message: 'With profile image, no ENS'
contentType: StatusMessage.ContentType.Text
@ -600,9 +594,8 @@ QtObject {
timestamp: "1658937930"
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
amIsender: false
userName: "Teenage Mutant Turtle"
ensName: "@turtle.statusofus.eth"
localName: "Bro from work"
senderOptionalName: "@turtle.statusofus.eth"
senderDisplayName: "Bro from work"
profileImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiElEQVR4nOzXUQpAQBRGYWQvLNAyLJDV8C5qpiGnv/M9al5Ot27X0IUwhMYQGkNoDKGJCRlLH67bftx9X+ap/+P9VcxEDKExhKZ4a9Uq3TZviZmIITSG0DRvlqcbqVbrlouZiCE0htD4h0hjCI0hNN5aNIbQGKKPxEzEEBpDaAyhMYTmDAAA//+gYCErzmCpCQAAAABJRU5ErkJggg="
message: 'With profile image and ENS'
contentType: StatusMessage.ContentType.Text
@ -627,9 +620,8 @@ QtObject {
timestamp: "1658937930"
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
amIsender: true
userName: "You"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "You"
senderOptionalName: "@ghd.statusofus.eth"
profileImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiElEQVR4nOzXUQpAQBRGYWQvLNAyLJDV8C5qpiGnv/M9al5Ot27X0IUwhMYQGkNoDKGJCRlLH67bftx9X+ap/+P9VcxEDKExhKZ4a9Uq3TZviZmIITSG0DRvlqcbqVbrlouZiCE0htD4h0hjCI0hNN5aNIbQGKKPxEzEEBpDaAyhMYTmDAAA//+gYCErzmCpCQAAAABJRU5ErkJggg="
message: 'Message with image'
contentType: StatusMessage.ContentType.Image
@ -654,9 +646,8 @@ QtObject {
timestamp: "1658937930"
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
amIsender: true
userName: "You"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "You"
senderOptionalName: "@ghd.statusofus.eth"
profileImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiElEQVR4nOzXUQpAQBRGYWQvLNAyLJDV8C5qpiGnv/M9al5Ot27X0IUwhMYQGkNoDKGJCRlLH67bftx9X+ap/+P9VcxEDKExhKZ4a9Uq3TZviZmIITSG0DRvlqcbqVbrlouZiCE0htD4h0hjCI0hNN5aNIbQGKKPxEzEEBpDaAyhMYTmDAAA//+gYCErzmCpCQAAAABJRU5ErkJggg="
message: '👍'
contentType: StatusMessage.ContentType.Emoji
@ -681,9 +672,8 @@ QtObject {
timestamp: "1658937930"
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
amIsender: true
userName: "You"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "You"
senderOptionalName: "@ghd.statusofus.eth"
profileImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAiElEQVR4nOzXUQpAQBRGYWQvLNAyLJDV8C5qpiGnv/M9al5Ot27X0IUwhMYQGkNoDKGJCRlLH67bftx9X+ap/+P9VcxEDKExhKZ4a9Uq3TZviZmIITSG0DRvlqcbqVbrlouZiCE0htD4h0hjCI0hNN5aNIbQGKKPxEzEEBpDaAyhMYTmDAAA//+gYCErzmCpCQAAAABJRU5ErkJggg="
message: 'Message with sticker'
contentType: StatusMessage.ContentType.Sticker
@ -708,9 +698,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
amIsender: true
userName: "You"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "You"
senderOptionalName: "@ghd.statusofus.eth"
message: ""
isCurrentUser: true
contentType: StatusMessage.ContentType.Audio
@ -737,9 +726,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: true
userName: "You"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "You"
senderOptionalName: "@ghd.statusofus.eth"
message: "Hi Johnny"
isCurrentUser: true
contentType: StatusMessage.ContentType.Text
@ -766,9 +754,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: false
userName: "Pompie"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "Pompie"
senderOptionalName: "@ghd.statusofus.eth"
message: '<p>Do you have a Bitcoin wallet or Coinbase wallet?<br />You can earn up to 0.06021BTC every 3 hours with your phone or PC...<br />Without referrals nor registration fee...<br />If you are interested ask me “HOW”<br /><a href="https://t.me/Markstones455">https://t.me/Markstones455</a></p>'
isCurrentUser: true
contentType: StatusMessage.ContentType.Text
@ -795,9 +782,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: false
userName: "Pompie"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "Pompie"
senderOptionalName: "@ghd.statusofus.eth"
message: '<p><a href="//0x0431859bd00be79baef9617f4719ce73d2d261a2496f9a861f447a2f8ba34bf7ba03e572bb39fcf2df43564d39f6364bfe9be0a1fca3bf741e8f4b9492f86db427" class="mention">Uniform Dark Pike</a></p>'
isCurrentUser: true
contentType: StatusMessage.ContentType.Text
@ -824,9 +810,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: false
userName: "Pompie"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "Pompie"
senderOptionalName: "@ghd.statusofus.eth"
message: "Replying to text message"
isCurrentUser: true
contentType: StatusMessage.ContentType.Text
@ -854,9 +839,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: false
userName: "Pompie"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "Pompie"
senderOptionalName: "@ghd.statusofus.eth"
message: "Replying to a Image Message"
isCurrentUser: true
contentType: StatusMessage.ContentType.Text
@ -884,9 +868,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: false
userName: "Pompie"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "Pompie"
senderOptionalName: "@ghd.statusofus.eth"
message: "Replying to a sticker message"
isCurrentUser: true
contentType: StatusMessage.ContentType.Text
@ -914,9 +897,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: false
userName: "Pompie"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "Pompie"
senderOptionalName: "@ghd.statusofus.eth"
message: "Replying to a Audio message"
isCurrentUser: true
contentType: StatusMessage.ContentType.Text
@ -944,9 +926,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: false
userName: "Pumba"
ensName: "@quite.statusofus.eth"
localName: ""
senderDisplayName: "Pumba"
senderOptionalName: "@quite.statusofus.eth"
message: "This is me"
isCurrentUser: true
contentType: StatusMessage.ContentType.Sticker
@ -973,9 +954,8 @@ QtObject {
timestamp: "1660937930"
senderId: "0x04d1bed19c523299cbd07ddec7b8949ad7dd923819a68e0b733c9c0bc38cde276bd256f098e755f8f028395c2c91f438a22adaff6caded060b7cc0ef3f470f1234"
amIsender: true
userName: "You"
ensName: "@ghd.statusofus.eth"
localName: ""
senderDisplayName: "You"
senderOptionalName: "@ghd.statusofus.eth"
message: ""
isCurrentUser: true
contentType: StatusMessage.ContentType.Image
@ -1002,9 +982,8 @@ QtObject {
timestamp: "1657937930"
amIsender: false
senderId: "0x043a7ed0e8752236a4688563652fd0296453cef00a5dcddbe252dc74f72cc1caa97a2b65e4a1a52d9c30a84c9966beaaaf6b333d659cbdd2e486b443ed1012cf04"
userName: "Teenage Mutant Turtle"
ensName: ""
localName: ""
senderDisplayName: "Teenage Mutant Turtle"
senderOptionalName: ""
profileImage: ""
contentType: StatusMessage.ContentType.Text
message: 'Simple text message from another user with reactions'

View File

@ -249,7 +249,7 @@ Rectangle {
id: profileImage
active: root.showHeader
visible: active
name: root.messageDetails.sender.userName
name: root.messageDetails.sender.displayName
asset: root.messageDetails.sender.profileImage.assetSettings
ringSettings: root.messageDetails.sender.profileImage.ringSettings

View File

@ -5,29 +5,17 @@ QtObject {
id: root
property string id: ""
property string userName: ""
property string ensName: ""
property string localName: ""
property string displayName: ""
property string secondaryName: ""
property bool isEnsVerified: false
property bool isContact: false
property int trustIndicator: StatusContactVerificationIcons.TrustedType.None
property StatusProfileImageSettings profileImage: StatusProfileImageSettings {
pubkey: root.id
showRing: !root.ensName
showRing: !root.isEnsVerified
width: 40
height: 40
}
readonly property string displayName: root.localName !== ""
? root.localName
: root.ensName !== ""
? root.ensName
: root.userName
readonly property string secondaryName: root.localName === ""
? ""
: root.ensName !== ""
? root.ensName
: root.userName
}

View File

@ -89,7 +89,7 @@ Item {
}
StatusBaseText {
id: tertiaryDetailText
visible: !root.amISender && messageOriginInfo == ""
visible: !root.amISender && root.messageOriginInfo === ""
Layout.alignment: Qt.AlignVCenter
font.pixelSize: 10
elide: Text.ElideMiddle

View File

@ -58,7 +58,7 @@ Item {
StatusSmartIdenticon {
id: profileImage
Layout.alignment: Qt.AlignTop
name: replyDetails.sender.userName
name: replyDetails.sender.displayName
asset: replyDetails.sender.profileImage.assetSettings
ringSettings: replyDetails.sender.profileImage.ringSettings
MouseArea {