fix: code review

This commit is contained in:
Richard Ramos 2020-11-17 11:14:24 -04:00 committed by Iuri Matias
parent 997e34ed8a
commit e4b4bf9900
2 changed files with 2 additions and 3 deletions

View File

@ -61,7 +61,6 @@ proc addContact*(self: ContactModel, id: string, localNickname: string): string
) )
let updating = contact.systemTags.contains(":contact/added") let updating = contact.systemTags.contains(":contact/added")
echo "C"
if not updating: if not updating:
contact.systemTags.add(":contact/added") contact.systemTags.add(":contact/added")
let nickname = let nickname =
@ -73,6 +72,7 @@ proc addContact*(self: ContactModel, id: string, localNickname: string): string
localNickname localNickname
result = status_contacts.saveContact(contact.id, contact.ensVerified, contact.ensName, contact.ensVerifiedAt, contact.ensVerificationRetries, contact.alias, contact.identicon, contact.systemTags, nickname) result = status_contacts.saveContact(contact.id, contact.ensVerified, contact.ensName, contact.ensVerifiedAt, contact.ensVerificationRetries, contact.alias, contact.identicon, contact.systemTags, nickname)
self.events.emit("contactAdded", Args()) self.events.emit("contactAdded", Args())
discard requestContactUpdate(contact.id)
if updating: if updating:
let profile = Profile( let profile = Profile(
id: contact.id, id: contact.id,

View File

@ -40,6 +40,5 @@ proc saveContact*(id: string, ensVerified: bool, ensName: string, ensVerifiedAt:
}] }]
callPrivateRPC("saveContact".prefix, payload) callPrivateRPC("saveContact".prefix, payload)
proc requestContactUpdate*(): string = proc requestContactUpdate*(publicKey: string): string =
let publicKey = $getSetting[string](Setting.PublicKey, "")
callPrivateRPC("sendContactUpdate".prefix, %* [publicKey, "", ""]) callPrivateRPC("sendContactUpdate".prefix, %* [publicKey, "", ""])