fix: do not display ENS name when not ENS verified
- expose "isEnsVerified" as model role - fix returning "ensName" when the user is not ensVerified - react to nickname updates correctly - fix sorting in the user/member list view
This commit is contained in:
parent
c209e7c282
commit
038ab08765
|
@ -79,6 +79,7 @@ method contactUpdated*(self: Module, publicKey: string) =
|
|||
pubKey = publicKey,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
@ -120,6 +121,7 @@ method addChatMember(self: Module, member: ChatMember) =
|
|||
pubKey = member.id,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
@ -158,6 +160,7 @@ method onChatMemberUpdated*(self: Module, publicKey: string, admin: bool, joined
|
|||
pubKey = publicKey,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
@ -177,4 +180,4 @@ method removeGroupMembers*(self: Module, pubKeys: seq[string]) =
|
|||
method updateMembersList*(self: Module) =
|
||||
let members = self.controller.getChatMembers()
|
||||
for member in members:
|
||||
self.addChatMember(member)
|
||||
self.addChatMember(member)
|
||||
|
|
|
@ -58,6 +58,7 @@ QtObject:
|
|||
pubKey = pubKey,
|
||||
displayName = displayName,
|
||||
ensName = "",
|
||||
isEnsVerified = false,
|
||||
localNickname = "",
|
||||
alias = "",
|
||||
icon = "",
|
||||
|
|
|
@ -247,10 +247,12 @@ proc createItemFromPublicKey(self: Module, publicKey: string): UserItem =
|
|||
pubKey = contactDetails.details.id,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
colorId = contactDetails.colorId,
|
||||
colorHash = contactDetails.colorHash,
|
||||
onlineStatus = toOnlineStatus(self.controller.getStatusForContactWithId(publicKey).statusType),
|
||||
isContact = contactDetails.details.isContact(),
|
||||
isVerified = contactDetails.details.isContactVerified(),
|
||||
|
|
|
@ -123,6 +123,7 @@ proc createMemberItem(self: Module, memberId, requestId: string): MemberItem =
|
|||
pubKey = memberId,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
|
|
@ -239,6 +239,9 @@ method getAppSearchModule*(self: AccessInterface): QVariant {.base.} =
|
|||
method getContactDetailsAsJson*(self: AccessInterface, publicKey: string, getVerificationRequest: bool): string {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method isEnsVerified*(self: AccessInterface, publicKey: string): bool {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method communityDataImported*(self: AccessInterface, community: CommunityDto) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
|
|
|
@ -293,6 +293,7 @@ proc createChannelGroupItem[T](self: Module[T], channelGroup: ChannelGroupDto):
|
|||
pubKey = member.id,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
@ -321,6 +322,7 @@ proc createChannelGroupItem[T](self: Module[T], channelGroup: ChannelGroupDto):
|
|||
pubKey = bannedMemberId,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
@ -338,6 +340,7 @@ proc createChannelGroupItem[T](self: Module[T], channelGroup: ChannelGroupDto):
|
|||
pubKey = requestDto.publicKey,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
@ -356,6 +359,7 @@ proc createChannelGroupItem[T](self: Module[T], channelGroup: ChannelGroupDto):
|
|||
pubKey = requestDto.publicKey,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
|
@ -955,6 +959,9 @@ method getContactDetailsAsJson*[T](self: Module[T], publicKey: string, getVerifi
|
|||
}
|
||||
return $jsonObj
|
||||
|
||||
method isEnsVerified*[T](self: Module[T], publicKey: string): bool =
|
||||
return self.controller.getContact(publicKey).ensVerified
|
||||
|
||||
method communityDataImported*[T](self: Module[T], community: CommunityDto) =
|
||||
if community.id == self.statusUrlCommunityToSpectate:
|
||||
self.statusUrlCommunityToSpectate = ""
|
||||
|
@ -1018,6 +1025,7 @@ method contactUpdated*[T](self: Module[T], publicKey: string) =
|
|||
publicKey,
|
||||
contactDetails.details.displayName,
|
||||
contactDetails.details.name,
|
||||
contactDetails.details.ensVerified,
|
||||
contactDetails.details.localNickname,
|
||||
contactDetails.details.alias,
|
||||
contactDetails.icon,
|
||||
|
|
|
@ -41,22 +41,23 @@ method delete*(self: Module) =
|
|||
self.view.delete
|
||||
|
||||
proc createItemFromPublicKey(self: Module, publicKey: string): UserItem =
|
||||
let contact = self.controller.getContact(publicKey)
|
||||
let contactDetails = self.controller.getContactDetails(contact.id)
|
||||
let contactDetails = self.controller.getContactDetails(publicKey)
|
||||
|
||||
return initUserItem(
|
||||
pubKey = contact.id,
|
||||
pubKey = contactDetails.details.id,
|
||||
displayName = contactDetails.details.displayName,
|
||||
ensName = contactDetails.details.name,
|
||||
isEnsVerified = contactDetails.details.ensVerified,
|
||||
localNickname = contactDetails.details.localNickname,
|
||||
alias = contactDetails.details.alias,
|
||||
icon = contactDetails.icon,
|
||||
colorId = contactDetails.colorId,
|
||||
colorHash = contactDetails.colorHash,
|
||||
onlineStatus = toOnlineStatus(self.controller.getStatusForContactWithId(publicKey).statusType),
|
||||
isContact = contact.isContact(),
|
||||
isBlocked = contact.isBlocked(),
|
||||
isVerified = contact.isContactVerified(),
|
||||
isUntrustworthy = contact.isContactUntrustworthy()
|
||||
isContact = contactDetails.details.isContact(),
|
||||
isVerified = contactDetails.details.isContactVerified(),
|
||||
isUntrustworthy = contactDetails.details.isContactUntrustworthy(),
|
||||
isBlocked = contactDetails.details.isBlocked(),
|
||||
)
|
||||
|
||||
proc buildModel(self: Module, model: Model, group: ContactsGroup) =
|
||||
|
@ -186,14 +187,18 @@ method contactsStatusUpdated*(self: Module, statusUpdates: seq[StatusUpdateDto])
|
|||
self.view.myMutualContactsModel().setOnlineStatus(s.publicKey, status)
|
||||
|
||||
method contactNicknameChanged*(self: Module, publicKey: string) =
|
||||
let (name, _, _) = self.controller.getContactNameAndImage(publicKey)
|
||||
self.view.myMutualContactsModel().updateName(publicKey, name)
|
||||
self.view.receivedContactRequestsModel().updateName(publicKey, name)
|
||||
self.view.sentContactRequestsModel().updateName(publicKey, name)
|
||||
let contactDetails = self.controller.getContactDetails(publicKey)
|
||||
let displayName = contactDetails.details.displayName
|
||||
let ensName = contactDetails.details.name
|
||||
let localNickname = contactDetails.details.localNickname
|
||||
|
||||
self.view.myMutualContactsModel().setName(publicKey, displayName, ensName, localNickname)
|
||||
self.view.receivedContactRequestsModel().setName(publicKey, displayName, ensName, localNickname)
|
||||
self.view.sentContactRequestsModel().setName(publicKey, displayName, ensName, localNickname)
|
||||
# Temporary commented until we provide appropriate flags on the `status-go` side to cover all sections.
|
||||
# self.view.receivedButRejectedContactRequestsModel().updateName(publicKey, name)
|
||||
# self.view.sentButRejectedContactRequestsModel().updateName(publicKey, name)
|
||||
self.view.blockedContactsModel().updateName(publicKey, name)
|
||||
# self.view.receivedButRejectedContactRequestsModel().setName(publicKey, displayName, ensName, localNickname)
|
||||
# self.view.sentButRejectedContactRequestsModel().setName(publicKey, displayName, ensName, localNickname)
|
||||
self.view.blockedContactsModel().setName(publicKey, displayName, ensName, localNickname)
|
||||
|
||||
method contactTrustStatusChanged*(self: Module, publicKey: string, isUntrustworthy: bool) =
|
||||
self.view.myMutualContactsModel().updateTrustStatus(publicKey, isUntrustworthy)
|
||||
|
@ -282,4 +287,4 @@ method requestContactInfo*(self: Module, publicKey: string) =
|
|||
self.controller.requestContactInfo(publicKey)
|
||||
|
||||
method onContactInfoRequestFinished*(self: Module, publicKey: string, ok: bool) =
|
||||
self.view.onContactInfoRequestFinished(publicKey, ok)
|
||||
self.view.onContactInfoRequestFinished(publicKey, ok)
|
||||
|
|
|
@ -210,6 +210,9 @@ QtObject:
|
|||
proc getContactDetailsAsJson(self: View, publicKey: string, getVerificationRequest: bool): string {.slot.} =
|
||||
return self.delegate.getContactDetailsAsJson(publicKey, getVerificationRequest)
|
||||
|
||||
proc isEnsVerified(self:View, publicKey: string): bool {.slot.} =
|
||||
return self.delegate.isEnsVerified(publicKey)
|
||||
|
||||
proc resolveENS*(self: View, ensName: string, uuid: string) {.slot.} =
|
||||
self.delegate.resolveENS(ensName, uuid)
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ proc initMemberItem*(
|
|||
pubKey: string,
|
||||
displayName: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
localNickname: string,
|
||||
alias: string,
|
||||
icon: string,
|
||||
|
@ -44,6 +45,7 @@ proc initMemberItem*(
|
|||
pubKey = pubKey,
|
||||
displayName = displayName,
|
||||
ensName = ensName,
|
||||
isEnsVerified = isEnsVerified,
|
||||
localNickname = localNickname,
|
||||
alias = alias,
|
||||
icon = icon,
|
||||
|
@ -64,6 +66,7 @@ proc `$`*(self: MemberItem): string =
|
|||
pubKey: {self.pubkey},
|
||||
displayName: {self.displayName},
|
||||
ensName: {self.ensName},
|
||||
isEnsVerified: {self.isEnsVerified},
|
||||
localNickname: {self.localNickname},
|
||||
alias: {self.alias},
|
||||
icon: {self.icon},
|
||||
|
|
|
@ -11,6 +11,7 @@ type
|
|||
PubKey = UserRole + 1
|
||||
DisplayName
|
||||
EnsName
|
||||
IsEnsVerified
|
||||
LocalNickname
|
||||
Alias
|
||||
Icon
|
||||
|
@ -77,6 +78,7 @@ QtObject:
|
|||
ModelRole.PubKey.int: "pubKey",
|
||||
ModelRole.DisplayName.int: "displayName",
|
||||
ModelRole.EnsName.int: "ensName",
|
||||
ModelRole.IsEnsVerified.int: "isEnsVerified",
|
||||
ModelRole.LocalNickname.int: "localNickname",
|
||||
ModelRole.Alias.int: "alias",
|
||||
ModelRole.Icon.int: "icon",
|
||||
|
@ -113,6 +115,8 @@ QtObject:
|
|||
result = newQVariant(item.displayName)
|
||||
of ModelRole.EnsName:
|
||||
result = newQVariant(item.ensName)
|
||||
of ModelRole.IsEnsVerified:
|
||||
result = newQVariant(item.isEnsVerified)
|
||||
of ModelRole.LocalNickname:
|
||||
result = newQVariant(item.localNickname)
|
||||
of ModelRole.Alias:
|
||||
|
@ -205,6 +209,7 @@ QtObject:
|
|||
pubKey: string,
|
||||
displayName: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
localNickname: string,
|
||||
alias: string,
|
||||
icon: string,
|
||||
|
@ -220,6 +225,7 @@ QtObject:
|
|||
|
||||
self.items[ind].displayName = displayName
|
||||
self.items[ind].ensName = ensName
|
||||
self.items[ind].isEnsVerified = isEnsVerified
|
||||
self.items[ind].localNickname = localNickname
|
||||
self.items[ind].alias = alias
|
||||
self.items[ind].icon = icon
|
||||
|
@ -232,6 +238,7 @@ QtObject:
|
|||
let index = self.createIndex(ind, 0, nil)
|
||||
self.dataChanged(index, index, @[
|
||||
ModelRole.DisplayName.int,
|
||||
ModelRole.IsEnsVerified.int,
|
||||
ModelRole.EnsName.int,
|
||||
ModelRole.LocalNickname.int,
|
||||
ModelRole.Alias.int,
|
||||
|
@ -248,6 +255,7 @@ QtObject:
|
|||
pubKey: string,
|
||||
displayName: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
localNickname: string,
|
||||
alias: string,
|
||||
icon: string,
|
||||
|
@ -261,6 +269,7 @@ QtObject:
|
|||
|
||||
self.items[ind].displayName = displayName
|
||||
self.items[ind].ensName = ensName
|
||||
self.items[ind].isEnsVerified = isEnsVerified
|
||||
self.items[ind].localNickname = localNickname
|
||||
self.items[ind].alias = alias
|
||||
self.items[ind].icon = icon
|
||||
|
@ -272,6 +281,7 @@ QtObject:
|
|||
self.dataChanged(index, index, @[
|
||||
ModelRole.DisplayName.int,
|
||||
ModelRole.EnsName.int,
|
||||
ModelRole.IsEnsVerified.int,
|
||||
ModelRole.LocalNickname.int,
|
||||
ModelRole.Alias.int,
|
||||
ModelRole.Icon.int,
|
||||
|
|
|
@ -163,15 +163,15 @@ QtObject:
|
|||
|
||||
proc pinned*(self: MessageItem): bool {.slot.} = result = ?.self.messageItem.pinned
|
||||
QtProperty[bool] pinned:
|
||||
read = bool
|
||||
read = pinned
|
||||
|
||||
proc editMode*(self: MessageItem): bool {.slot.} = result = ?.self.messageItem.editMode
|
||||
QtProperty[bool] editMode:
|
||||
read = bool
|
||||
read = editMode
|
||||
|
||||
proc isEdited*(self: MessageItem): bool {.slot.} = result = ?.self.messageItem.isEdited
|
||||
QtProperty[bool] isEdited:
|
||||
read = bool
|
||||
read = isEdited
|
||||
|
||||
# this is not the greatest approach, but aligns with the rest of the code
|
||||
proc communityId*(self: MessageItem): string {.slot.} = result = ?.self.messageItem.communityId
|
||||
|
|
|
@ -249,13 +249,14 @@ QtObject:
|
|||
pubkey: string,
|
||||
name: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
localNickname: string,
|
||||
alias: string,
|
||||
image: string,
|
||||
isContact: bool,
|
||||
isVerified: bool,
|
||||
isUntrustworthy: bool) =
|
||||
self.item.updateMember(pubkey, name, ensName, localNickname, alias, image, isContact,
|
||||
self.item.updateMember(pubkey, name, ensName, isEnsVerified, localNickname, alias, image, isContact,
|
||||
isVerified, isUntrustworthy)
|
||||
|
||||
proc pendingRequestsToJoin(self: SectionDetails): QVariant {.slot.} =
|
||||
|
|
|
@ -278,13 +278,14 @@ proc updateMember*(
|
|||
pubkey: string,
|
||||
name: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
nickname: string,
|
||||
alias: string,
|
||||
image: string,
|
||||
isContact: bool,
|
||||
isVerified: bool,
|
||||
isUntrustworthy: bool) =
|
||||
self.membersModel.updateItem(pubkey, name, ensName, nickname, alias, image, isContact,
|
||||
self.membersModel.updateItem(pubkey, name, ensName, isEnsVerified, nickname, alias, image, isContact,
|
||||
isVerified, isUntrustworthy)
|
||||
|
||||
proc bannedMembers*(self: SectionItem): member_model.Model {.inline.} =
|
||||
|
|
|
@ -23,6 +23,7 @@ type
|
|||
pubKey: string
|
||||
displayName: string
|
||||
ensName: string
|
||||
isEnsVerified: bool
|
||||
localNickname: string
|
||||
alias: string
|
||||
icon: string
|
||||
|
@ -41,6 +42,7 @@ proc setup*(self: UserItem,
|
|||
pubKey: string,
|
||||
displayName: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
localNickname: string,
|
||||
alias: string,
|
||||
icon: string,
|
||||
|
@ -58,6 +60,7 @@ proc setup*(self: UserItem,
|
|||
self.pubKey = pubKey
|
||||
self.displayName = displayName
|
||||
self.ensName = ensName
|
||||
self.isEnsVerified = isEnsVerified
|
||||
self.localNickname = localNickname
|
||||
self.alias = alias
|
||||
self.icon = icon
|
||||
|
@ -77,6 +80,7 @@ proc initUserItem*(
|
|||
pubKey: string,
|
||||
displayName: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
localNickname: string,
|
||||
alias: string,
|
||||
icon: string,
|
||||
|
@ -96,6 +100,7 @@ proc initUserItem*(
|
|||
pubKey = pubKey,
|
||||
displayName = displayName,
|
||||
ensName = ensName,
|
||||
isEnsVerified = isEnsVerified,
|
||||
localNickname = localNickname,
|
||||
alias = alias,
|
||||
icon = icon,
|
||||
|
@ -115,6 +120,7 @@ proc `$`*(self: UserItem): string =
|
|||
pubKey: {self.pubkey},
|
||||
displayName: {self.displayName},
|
||||
ensName: {self.ensName},
|
||||
isEnsVerified: {self.isEnsVerified},
|
||||
localNickname: {self.localNickname},
|
||||
alias: {self.alias},
|
||||
icon: {self.icon},
|
||||
|
@ -140,11 +146,17 @@ proc `displayName=`*(self: UserItem, value: string) {.inline.} =
|
|||
self.displayName = value
|
||||
|
||||
proc ensName*(self: UserItem): string {.inline.} =
|
||||
self.ensName
|
||||
if self.isEnsVerified: self.ensName else: ""
|
||||
|
||||
proc `ensName=`*(self: UserItem, value: string) {.inline.} =
|
||||
self.ensName = value
|
||||
|
||||
proc isEnsVerified*(self: UserItem): bool {.inline.} =
|
||||
self.isEnsVerified
|
||||
|
||||
proc `isEnsVerified=`*(self: UserItem, value: bool) {.inline.} =
|
||||
self.isEnsVerified = value
|
||||
|
||||
proc localNickname*(self: UserItem): string {.inline.} =
|
||||
self.localNickname
|
||||
|
||||
|
@ -170,7 +182,7 @@ proc `colorId=`*(self: UserItem, value: int) {.inline.} =
|
|||
self.colorId = value
|
||||
|
||||
proc colorHash*(self: UserItem): string {.inline.} =
|
||||
self.colorHash
|
||||
if not self.isEnsVerified: self.colorHash else: ""
|
||||
|
||||
proc `colorHash=`*(self: UserItem, value: string) {.inline.} =
|
||||
self.colorHash = value
|
||||
|
|
|
@ -8,6 +8,7 @@ type
|
|||
PubKey = UserRole + 1
|
||||
DisplayName
|
||||
EnsName
|
||||
IsEnsVerified
|
||||
LocalNickname
|
||||
Alias
|
||||
Icon
|
||||
|
@ -67,6 +68,7 @@ QtObject:
|
|||
ModelRole.PubKey.int: "pubKey",
|
||||
ModelRole.DisplayName.int: "displayName",
|
||||
ModelRole.EnsName.int: "ensName",
|
||||
ModelRole.IsEnsVerified.int: "isEnsVerified",
|
||||
ModelRole.LocalNickname.int: "localNickname",
|
||||
ModelRole.Alias.int: "alias",
|
||||
ModelRole.Icon.int: "icon",
|
||||
|
@ -99,6 +101,8 @@ QtObject:
|
|||
result = newQVariant(item.displayName)
|
||||
of ModelRole.EnsName:
|
||||
result = newQVariant(item.ensName)
|
||||
of ModelRole.IsEnsVerified:
|
||||
result = newQVariant(item.isEnsVerified)
|
||||
of ModelRole.LocalNickname:
|
||||
result = newQVariant(item.localNickname)
|
||||
of ModelRole.Alias:
|
||||
|
@ -227,6 +231,7 @@ QtObject:
|
|||
pubKey: string,
|
||||
displayName: string,
|
||||
ensName: string,
|
||||
isEnsVerified: bool,
|
||||
localNickname: string,
|
||||
alias: string,
|
||||
icon: string,
|
||||
|
@ -238,6 +243,7 @@ QtObject:
|
|||
|
||||
self.items[ind].displayName = displayName
|
||||
self.items[ind].ensName = ensName
|
||||
self.items[ind].isEnsVerified = isEnsVerified
|
||||
self.items[ind].localNickname = localNickname
|
||||
self.items[ind].alias = alias
|
||||
self.items[ind].icon = icon
|
||||
|
@ -247,6 +253,7 @@ QtObject:
|
|||
self.dataChanged(index, index, @[
|
||||
ModelRole.DisplayName.int,
|
||||
ModelRole.EnsName.int,
|
||||
ModelRole.IsEnsVerified.int,
|
||||
ModelRole.LocalNickname.int,
|
||||
ModelRole.Alias.int,
|
||||
ModelRole.Icon.int,
|
||||
|
@ -254,23 +261,6 @@ QtObject:
|
|||
])
|
||||
self.itemChanged(pubKey)
|
||||
|
||||
proc updateName*(
|
||||
self: Model,
|
||||
pubKey: string,
|
||||
displayName: string
|
||||
) =
|
||||
let ind = self.findIndexByPubKey(pubKey)
|
||||
if(ind == -1):
|
||||
return
|
||||
|
||||
self.items[ind].displayName = displayName
|
||||
|
||||
let index = self.createIndex(ind, 0, nil)
|
||||
self.dataChanged(index, index, @[
|
||||
ModelRole.DisplayName.int
|
||||
])
|
||||
self.itemChanged(pubKey)
|
||||
|
||||
proc updateIncomingRequestStatus*(
|
||||
self: Model,
|
||||
pubKey: string,
|
||||
|
|
|
@ -133,8 +133,10 @@ proc toVerificationRequest*(jsonObj: JsonNode): VerificationRequest =
|
|||
proc toContactsDto*(jsonObj: JsonNode): ContactsDto =
|
||||
result = ContactsDto()
|
||||
discard jsonObj.getProp("id", result.id)
|
||||
discard jsonObj.getProp("name", result.name)
|
||||
discard jsonObj.getProp("ensVerified", result.ensVerified)
|
||||
result.name = ""
|
||||
if (result.ensVerified):
|
||||
discard jsonObj.getProp("name", result.name)
|
||||
discard jsonObj.getProp("displayName", result.displayName)
|
||||
discard jsonObj.getProp("alias", result.alias)
|
||||
discard jsonObj.getProp("lastUpdated", result.lastUpdated)
|
||||
|
|
|
@ -570,7 +570,7 @@ QtObject:
|
|||
result.isCurrentUser = pubKey == singletonInstance.userProfile.getPubKey()
|
||||
result.details = contactDto
|
||||
if not contactDto.ensVerified:
|
||||
result.colorHash = procs_from_visual_identity_service.getColorHashAsJson(pubKey)
|
||||
result.colorHash = procs_from_visual_identity_service.getColorHashAsJson(pubKey)
|
||||
|
||||
proc markUntrustworthy*(self: Service, publicKey: string) =
|
||||
let response = status_contacts.markUntrustworthy(publicKey)
|
||||
|
@ -791,4 +791,4 @@ QtObject:
|
|||
)
|
||||
self.threadpool.start(arg)
|
||||
except Exception as e:
|
||||
error "Error requesting contact info", msg = e.msg, pubkey
|
||||
error "Error requesting contact info", msg = e.msg, pubkey
|
||||
|
|
|
@ -108,16 +108,16 @@ Item {
|
|||
|
||||
Loader {
|
||||
id: tertiaryDetailTextLoader
|
||||
active: !root.amISender && root.messageOriginInfo === ""
|
||||
active: !root.amISender && root.messageOriginInfo === "" && !!root.tertiaryDetail
|
||||
visible: active
|
||||
asynchronous: true
|
||||
sourceComponent: StatusBaseText {
|
||||
id: tertiaryDetailText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pixelSize: Theme.asideTextFontSize
|
||||
visible: text
|
||||
elide: Text.ElideMiddle
|
||||
color: Theme.palette.baseColor1
|
||||
text: root.tertiaryDetail ? Utils.elideText(root.tertiaryDetail, 5, 3) : ""
|
||||
text: Utils.elideText(root.tertiaryDetail, 5, 3)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,13 +60,21 @@ Item {
|
|||
model: SortFilterProxyModel {
|
||||
sourceModel: root.usersModel
|
||||
|
||||
proxyRoles: ExpressionRole {
|
||||
function displayNameProxy(nickname, ensName, displayName, aliasName) {
|
||||
return ProfileUtils.displayName(nickname, ensName, displayName, aliasName)
|
||||
}
|
||||
name: "preferredDisplayName"
|
||||
expression: displayNameProxy(model.localNickname, model.ensName, model.displayName, model.alias)
|
||||
}
|
||||
|
||||
sorters: [
|
||||
RoleSorter {
|
||||
roleName: "onlineStatus"
|
||||
sortOrder: Qt.DescendingOrder
|
||||
},
|
||||
StringSorter {
|
||||
roleName: "displayName"
|
||||
roleName: "preferredDisplayName"
|
||||
caseSensitivity: Qt.CaseInsensitive
|
||||
}
|
||||
]
|
||||
|
@ -74,11 +82,10 @@ Item {
|
|||
section.property: "onlineStatus"
|
||||
section.delegate: (root.width > 58) ? sectionDelegateComponent : null
|
||||
delegate: StatusMemberListItem {
|
||||
readonly property bool ensVerified: Utils.isEnsVerified(model.pubKey)
|
||||
width: ListView.view.width
|
||||
nickName: model.localNickname
|
||||
userName: ProfileUtils.displayName("", model.ensName, model.displayName, model.alias)
|
||||
pubKey: ensVerified ? "" : Utils.getCompressedPk(model.pubKey)
|
||||
pubKey: model.isEnsVerified ? "" : Utils.getCompressedPk(model.pubKey)
|
||||
isContact: model.isContact
|
||||
isVerified: model.isVerified
|
||||
isUntrustworthy: model.isUntrustworthy
|
||||
|
|
|
@ -51,7 +51,7 @@ Item {
|
|||
rightPadding: 0
|
||||
placeholderText: root.placeholderText
|
||||
input.asset.name: "search"
|
||||
enabled: model.count > 0
|
||||
enabled: !!model && model.count > 0
|
||||
}
|
||||
|
||||
ListView {
|
||||
|
@ -131,7 +131,7 @@ Item {
|
|||
height: visible ? implicitHeight : 0
|
||||
color: "transparent"
|
||||
|
||||
pubKey: model.ensName ? "" : Utils.getElidedCompressedPk(model.pubKey)
|
||||
pubKey: model.isEnsVerified ? "" : Utils.getElidedCompressedPk(model.pubKey)
|
||||
nickName: model.localNickname
|
||||
userName: ProfileUtils.displayName("", model.ensName, model.displayName, model.alias)
|
||||
status: model.onlineStatus
|
||||
|
|
|
@ -35,14 +35,12 @@ ColumnLayout {
|
|||
Layout.rightMargin: Style.current.padding
|
||||
}
|
||||
|
||||
StatusInput {
|
||||
SearchBox {
|
||||
id: filterInput
|
||||
placeholderText: qsTr("Search contacts")
|
||||
maximumHeight: 36
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
input.asset.name: "search"
|
||||
input.clearable: true
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.current.bigPadding
|
||||
Layout.bottomMargin: Style.current.padding
|
||||
|
|
|
@ -467,6 +467,7 @@ StatusSectionLayout {
|
|||
MessageContextMenuView {
|
||||
id: memberContextMenuView
|
||||
store: root.rootStore
|
||||
isProfile: true
|
||||
amIChatAdmin: root.rootStore.amIChatAdmin()
|
||||
myPublicKey: root.rootStore.myPublicKey()
|
||||
|
||||
|
|
|
@ -93,10 +93,11 @@ Item {
|
|||
|
||||
delegate: ContactPanel {
|
||||
id: panelDelegate
|
||||
|
||||
width: ListView.view.width
|
||||
contactsStore: root.contactsStore
|
||||
name: ProfileUtils.displayName(model.localNickname, model.ensName, model.displayName, model.alias)
|
||||
ensVerified: !!model.ensName
|
||||
ensVerified: model.isEnsVerified
|
||||
publicKey: model.pubKey
|
||||
compressedPk: Utils.getCompressedPk(model.pubKey)
|
||||
iconSource: model.icon
|
||||
|
|
|
@ -17,13 +17,9 @@ import "../stores"
|
|||
ActivityNotificationMessage {
|
||||
id: root
|
||||
|
||||
readonly property var contactDetails: notification ?
|
||||
Utils.getContactDetailsAsJson(notification.author, false) :
|
||||
null
|
||||
contactDetails: notification ? Utils.getContactDetailsAsJson(notification.author, false) : null
|
||||
|
||||
messageDetails.messageText: qsTr("Wants to join")
|
||||
messageDetails.sender.displayName: contactDetails ? contactDetails.displayName : ""
|
||||
messageDetails.sender.secondaryName: contactDetails ? contactDetails.localNickname : ""
|
||||
messageDetails.sender.profileImage.name: contactDetails ? contactDetails.displayIcon : ""
|
||||
messageDetails.sender.profileImage.assetSettings.isImage: true
|
||||
messageDetails.sender.profileImage.pubkey: notification ? notification.author : ""
|
||||
|
|
|
@ -24,10 +24,10 @@ ActivityNotificationBase {
|
|||
messageText: notification ? notification.message.messageText : ""
|
||||
amISender: false
|
||||
sender.id: contactId
|
||||
sender.displayName: contactDetails ? ProfileUtils.displayName(contactDetails.localNickname, contactDetails.ensVerified ? contactDetails.name : "",
|
||||
sender.displayName: contactDetails ? ProfileUtils.displayName(contactDetails.localNickname, contactDetails.name,
|
||||
contactDetails.displayName, contactDetails.alias) : ""
|
||||
sender.secondaryName: contactDetails && contactDetails.localNickname ? ProfileUtils.displayName("", contactDetails.ensVerified ? contactDetails.name : "",
|
||||
contactDetails.displayName, contactDetails.alias) : ""
|
||||
sender.secondaryName: contactDetails && contactDetails.localNickname ?
|
||||
ProfileUtils.displayName("", contactDetails.name, contactDetails.displayName, contactDetails.alias) : ""
|
||||
sender.trustIndicator: contactDetails ? contactDetails.trustStatus : Constants.trustStatus.unknown
|
||||
sender.isEnsVerified: !!contactDetails && contactDetails.ensVerified
|
||||
sender.isContact: !!contactDetails && contactDetails.isContact
|
||||
|
|
|
@ -14,20 +14,19 @@ StatusMemberListItem {
|
|||
id: root
|
||||
|
||||
readonly property string _pubKey: model.pubKey // expose uncompressed pubkey
|
||||
readonly property bool hasEnsName: Utils.isEnsVerified(model.pubKey)
|
||||
|
||||
pubKey: hasEnsName ? "" : Utils.getCompressedPk(model.pubKey)
|
||||
pubKey: model.isEnsVerified ? "" : Utils.getCompressedPk(model.pubKey)
|
||||
nickName: model.localNickname
|
||||
userName: ProfileUtils.displayName("", model.ensName, model.displayName, model.alias)
|
||||
isVerified: model.isVerified
|
||||
isUntrustworthy: model.isUntrustworthy
|
||||
isContact: model.isContact
|
||||
asset.name: model.icon
|
||||
asset.color: Utils.colorForPubkey(model.pubKey)
|
||||
asset.color: Utils.colorForColorId(model.colorId)
|
||||
asset.isImage: (asset.name !== "")
|
||||
asset.isLetterIdenticon: (asset.name === "")
|
||||
status: model.onlineStatus
|
||||
statusListItemIcon.badge.border.color: sensor.containsMouse ? Theme.palette.baseColor2 : Theme.palette.baseColor4
|
||||
ringSettings.ringSpecModel: Utils.getColorHashAsJson(model.pubKey, hasEnsName)
|
||||
ringSettings.ringSpecModel: model.colorHash
|
||||
color: (sensor.containsMouse || highlighted) ? Theme.palette.baseColor2 : "transparent"
|
||||
}
|
||||
|
|
|
@ -83,8 +83,7 @@ Item {
|
|||
|
||||
delegate: StatusMemberListItem {
|
||||
width: contactListView.availableWidth
|
||||
|
||||
pubKey: Utils.getCompressedPk(model.pubKey)
|
||||
pubKey: model.isEnsVerified ? "" : Utils.getCompressedPk(model.pubKey)
|
||||
isContact: model.isContact
|
||||
status: model.onlineStatus
|
||||
height: visible ? implicitHeight : 0
|
||||
|
@ -97,7 +96,7 @@ Item {
|
|||
asset.width: 40
|
||||
asset.height: 40
|
||||
asset.color: Utils.colorForColorId(model.colorId)
|
||||
ringSettings.ringSpecModel: Utils.getColorHashAsJson(model.pubKey, model.ensName)
|
||||
ringSettings.ringSpecModel: model.colorHash
|
||||
statusListItemIcon.badge.border.color: Theme.palette.baseColor4
|
||||
statusListItemIcon.badge.implicitHeight: 14 // 10 px + 2 px * 2 borders
|
||||
statusListItemIcon.badge.implicitWidth: 14 // 10 px + 2 px * 2 borders
|
||||
|
|
|
@ -46,7 +46,7 @@ Item {
|
|||
|
||||
delegate: StatusMemberListItem {
|
||||
width: contactGridView.cellWidth
|
||||
pubKey: Utils.getCompressedPk(model.pubKey)
|
||||
pubKey: model.isEnsVerified ? "" : Utils.getCompressedPk(model.pubKey)
|
||||
isContact: model.isContact
|
||||
status: model.onlineStatus
|
||||
nickName: model.localNickname
|
||||
|
@ -59,7 +59,7 @@ Item {
|
|||
asset.height: 40
|
||||
color: "transparent"
|
||||
asset.color: Utils.colorForColorId(model.colorId)
|
||||
ringSettings.ringSpecModel: Utils.getColorHashAsJson(model.pubKey)
|
||||
ringSettings.ringSpecModel: model.colorHash
|
||||
statusListItemIcon.badge.border.color: Theme.palette.baseColor4
|
||||
statusListItemIcon.badge.implicitHeight: 14 // 10 px + 2 px * 2 borders
|
||||
statusListItemIcon.badge.implicitWidth: 14 // 10 px + 2 px * 2 borders
|
||||
|
|
|
@ -697,6 +697,7 @@ Pane {
|
|||
Layout.rightMargin: column.anchors.rightMargin
|
||||
bottomPadding: -4
|
||||
StatusTabButton {
|
||||
leftPadding: 0
|
||||
width: implicitWidth
|
||||
text: qsTr("Communities")
|
||||
}
|
||||
|
@ -709,7 +710,6 @@ Pane {
|
|||
text: qsTr("Collectibles")
|
||||
}
|
||||
StatusTabButton {
|
||||
leftPadding: 0
|
||||
width: implicitWidth
|
||||
text: qsTr("Assets")
|
||||
}
|
||||
|
|
|
@ -443,8 +443,7 @@ Loader {
|
|||
if (!root.pinnedMessage || root.isDiscordMessage)
|
||||
return ""
|
||||
const contact = Utils.getContactDetailsAsJson(root.messagePinnedBy, false)
|
||||
const ensName = contact.ensVerified ? contact.name : ""
|
||||
return ProfileUtils.displayName(contact.localNickname, ensName, contact.displayName, contact.alias)
|
||||
return ProfileUtils.displayName(contact.localNickname, contact.name, contact.displayName, contact.alias)
|
||||
}
|
||||
isInPinnedPopup: root.isInPinnedPopup
|
||||
hasExpired: root.isExpired
|
||||
|
|
|
@ -55,7 +55,7 @@ RowLayout {
|
|||
sender: root.messageDetails.sender
|
||||
amISender: root.messageDetails.amISender
|
||||
messageOriginInfo: root.messageDetails.messageOriginInfo
|
||||
tertiaryDetail: Utils.getElidedCompressedPk(sender.id)
|
||||
tertiaryDetail: sender.isEnsVerified ? "" : Utils.getElidedCompressedPk(sender.id)
|
||||
timestamp: root.timestamp
|
||||
onClicked: root.openProfilePopup()
|
||||
}
|
||||
|
|
|
@ -436,7 +436,7 @@ QtObject {
|
|||
function isEnsVerified(publicKey) {
|
||||
if (publicKey === "" || !isChatKey(publicKey) )
|
||||
return
|
||||
return getContactDetailsAsJson(publicKey, false).ensVerified
|
||||
return mainModuleInst.isEnsVerified(publicKey)
|
||||
}
|
||||
|
||||
function getEmojiHashAsJson(publicKey) {
|
||||
|
|
Loading…
Reference in New Issue