mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-17 00:56:39 +00:00
feat(communities): make requestCommunityInfo accept private keys
Fixes #11273 Enables passing a private key as well as a public key to `RequestCommunityInfoFromMailserver`. Also fixes a small issue in the error handling in the service
This commit is contained in:
parent
461bbbc06f
commit
d4a4f96a8a
@ -267,3 +267,6 @@ QtObject:
|
|||||||
|
|
||||||
proc windowDeactivated*(self: View) {.slot.} =
|
proc windowDeactivated*(self: View) {.slot.} =
|
||||||
self.delegate.windowDeactivated()
|
self.delegate.windowDeactivated()
|
||||||
|
|
||||||
|
proc setCommunityIdToSpectate*(self: View, communityId: string) {.slot.} =
|
||||||
|
self.delegate.setCommunityIdToSpectate(communityId)
|
||||||
|
@ -1353,7 +1353,7 @@ QtObject:
|
|||||||
|
|
||||||
proc asyncCommunityInfoLoaded*(self: Service, communityIdAndRpcResponse: string) {.slot.} =
|
proc asyncCommunityInfoLoaded*(self: Service, communityIdAndRpcResponse: string) {.slot.} =
|
||||||
let rpcResponseObj = communityIdAndRpcResponse.parseJson
|
let rpcResponseObj = communityIdAndRpcResponse.parseJson
|
||||||
if (rpcResponseObj{"error"}.kind != JNull):
|
if rpcResponseObj{"error"}.kind != JNull and rpcResponseObj{"error"}.getStr != "":
|
||||||
error "Error requesting community info", msg = rpcResponseObj{"error"}
|
error "Error requesting community info", msg = rpcResponseObj{"error"}
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -1387,7 +1387,7 @@ QtObject:
|
|||||||
let rpcResponseObj = rpcResponse.parseJson
|
let rpcResponseObj = rpcResponse.parseJson
|
||||||
if rpcResponseObj{"error"}.kind != JNull and rpcResponseObj{"error"}.getStr != "":
|
if rpcResponseObj{"error"}.kind != JNull and rpcResponseObj{"error"}.getStr != "":
|
||||||
let error = Json.decode($rpcResponseObj["error"], RpcError)
|
let error = Json.decode($rpcResponseObj["error"], RpcError)
|
||||||
error "Error requesting community info", msg = error.message
|
error "Error checking permissions to join", msg = error.message
|
||||||
return
|
return
|
||||||
|
|
||||||
let communityId = rpcResponseObj{"communityId"}.getStr()
|
let communityId = rpcResponseObj{"communityId"}.getStr()
|
||||||
@ -1418,7 +1418,7 @@ QtObject:
|
|||||||
let rpcResponseObj = communityIdAndRpcResponse.parseJson
|
let rpcResponseObj = communityIdAndRpcResponse.parseJson
|
||||||
if (rpcResponseObj{"response"}{"error"}.kind != JNull):
|
if (rpcResponseObj{"response"}{"error"}.kind != JNull):
|
||||||
let error = Json.decode($rpcResponseObj["response"]["error"], RpcError)
|
let error = Json.decode($rpcResponseObj["response"]["error"], RpcError)
|
||||||
error "Error requesting community info", msg = error.message
|
error "Error requesting to join community", msg = error.message
|
||||||
return
|
return
|
||||||
|
|
||||||
let rpcResponse = Json.decode($rpcResponseObj["response"], RpcResponse[JsonNode])
|
let rpcResponse = Json.decode($rpcResponseObj["response"], RpcResponse[JsonNode])
|
||||||
@ -1497,7 +1497,7 @@ QtObject:
|
|||||||
try:
|
try:
|
||||||
let rpcResponseObj = response.parseJson
|
let rpcResponseObj = response.parseJson
|
||||||
if (rpcResponseObj{"error"}.kind != JNull and rpcResponseObj{"error"}.getStr != ""):
|
if (rpcResponseObj{"error"}.kind != JNull and rpcResponseObj{"error"}.getStr != ""):
|
||||||
error "Error requesting community info", msg = rpcResponseObj{"error"}.getStr
|
error "Error loading curated communities", msg = rpcResponseObj{"error"}.getStr
|
||||||
self.events.emit(SIGNAL_CURATED_COMMUNITIES_LOADING_FAILED, Args())
|
self.events.emit(SIGNAL_CURATED_COMMUNITIES_LOADING_FAILED, Args())
|
||||||
return
|
return
|
||||||
let curatedCommunities = parseCuratedCommunities(rpcResponseObj["response"]["result"])
|
let curatedCommunities = parseCuratedCommunities(rpcResponseObj["response"]["result"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user