fix: add contact using status ens name
This commit is contained in:
parent
4b7769c391
commit
2ac67f95aa
|
@ -119,15 +119,19 @@ QtObject:
|
||||||
id = status_ens.pubkey(id)
|
id = status_ens.pubkey(id)
|
||||||
id
|
id
|
||||||
|
|
||||||
|
proc ensWasResolved*(self: ContactsView, resolvedPubKey: string) {.signal.}
|
||||||
|
|
||||||
proc ensResolved(self: ContactsView, id: string) {.slot.} =
|
proc ensResolved(self: ContactsView, id: string) {.slot.} =
|
||||||
|
self.ensWasResolved(id)
|
||||||
let contact = self.status.contacts.getContactByID(id)
|
let contact = self.status.contacts.getContactByID(id)
|
||||||
|
|
||||||
if contact != nil:
|
if contact != nil:
|
||||||
self.contactToAdd = contact
|
self.contactToAdd = contact
|
||||||
else:
|
else:
|
||||||
self.contactToAdd = Profile(
|
self.contactToAdd = Profile(
|
||||||
|
address: id,
|
||||||
username: "",
|
username: "",
|
||||||
alias: "",
|
alias: generateAlias(id),
|
||||||
ensName: "",
|
ensName: "",
|
||||||
ensVerified: false
|
ensVerified: false
|
||||||
)
|
)
|
||||||
|
|
|
@ -189,6 +189,17 @@ Item {
|
||||||
visible: !contactsContainer.isPending && !!!profileModel.contacts.contactToAddUsername
|
visible: !contactsContainer.isPending && !!!profileModel.contacts.contactToAddUsername
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: profileModel.contacts
|
||||||
|
onEnsWasResolved: {
|
||||||
|
if(addContactSearchInput.text !== "" && !Utils.isHex(addContactSearchInput.text) && resolvedPubKey !== ""){
|
||||||
|
contactUsername.text = Qt.binding(function () {
|
||||||
|
return chatsModel.formatENSUsername(addContactSearchInput.text) + " • "
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: contactUsername
|
id: contactUsername
|
||||||
text: profileModel.contacts.contactToAddUsername + " • "
|
text: profileModel.contacts.contactToAddUsername + " • "
|
||||||
|
|
Loading…
Reference in New Issue