Fix(ProfileShowcase): send contact update when bio changes

fixes #12617
This commit is contained in:
Andrey Bocharnikov 2024-05-16 20:40:46 +04:00
parent b771ac6aed
commit cd7de2a2e5
3 changed files with 22 additions and 4 deletions

View File

@ -91,7 +91,7 @@ proc getBio*(self: Controller): string =
self.settingsService.getBio()
proc setBio*(self: Controller, bio: string): bool =
self.settingsService.saveBio(bio)
self.profileService.setBio(bio)
proc saveProfileShowcasePreferences*(self: Controller, preferences: ProfileShowcasePreferencesDto, revealedAddresses: seq[string]) =
self.profileService.saveProfileShowcasePreferences(preferences)

View File

@ -88,17 +88,31 @@ QtObject:
proc setDisplayName*(self: Service, displayName: string): bool =
try:
let response = status_accounts.setDisplayName(displayName)
if(not response.error.isNil):
if not response.error.isNil:
error "could not set display name"
return false
if(not self.settingsService.saveDisplayName(displayName)):
error "could save display name to the settings"
if not self.settingsService.saveDisplayName(displayName):
error "could not save display name to the settings"
return false
return true
except Exception as e:
error "error: ", procName="setDisplayName", errName = e.name, errDesription = e.msg
return false
proc setBio*(self: Service, bio: string): bool =
try:
let response = status_accounts.setBio(bio)
if not response.error.isNil:
error "could not set bio"
return false
if not self.settingsService.saveBio(bio):
error "could not set bio to the settings"
return false
return true
except Exception as e:
error "error: ", procName="setBio", errName = e.name, errDesription = e.msg
return false
proc requestProfileShowcasePreferences*(self: Service) =
let arg = QObjectTaskArg(
tptr: cast[ByteAddress](asyncGetProfileShowcasePreferencesTask),

View File

@ -421,6 +421,10 @@ proc setDisplayName*(displayName: string): RpcResponse[JsonNode] =
let payload = %* [displayName]
result = core.callPrivateRPC("setDisplayName".prefix, payload)
proc setBio*(bio: string): RpcResponse[JsonNode] =
let payload = %* [bio]
result = core.callPrivateRPC("setBio".prefix, payload)
proc getDerivedAddresses*(password: string, derivedFrom: string, paths: seq[string]): RpcResponse[JsonNode] =
let payload = %* [password, derivedFrom, paths]
result = core.callPrivateRPC("wallet_getDerivedAddresses", payload)