refactor(community): add missing community functions (#152)

This commit is contained in:
Jonathan Rainville 2022-01-05 11:34:21 -05:00 committed by saledjenic
parent 40ad92f533
commit 21fcce96ed
1 changed files with 22 additions and 0 deletions

View File

@ -171,3 +171,25 @@ proc importCommunity*(communityKey: string): RpcResponse[JsonNode] {.raises: [Ex
proc exportCommunity*(communityId: string): RpcResponse[JsonNode] {.raises: [Exception].} =
result = callPrivateRPC("exportCommunity".prefix, %*[communityId])
proc removeUserFromCommunity*(communityId: string, pubKey: string): RpcResponse[JsonNode] {.raises: [Exception].} =
result = callPrivateRPC("removeUserFromCommunity".prefix, %*[communityId, pubKey])
proc acceptRequestToJoinCommunity*(requestId: string): RpcResponse[JsonNode] {.raises: [Exception].} =
return callPrivateRPC("acceptRequestToJoinCommunity".prefix, %*[{
"id": requestId
}])
proc declineRequestToJoinCommunity*(requestId: string): RpcResponse[JsonNode] {.raises: [Exception].} =
return callPrivateRPC("declineRequestToJoinCommunity".prefix, %*[{
"id": requestId
}])
proc banUserFromCommunity*(communityId: string, pubKey: string): RpcResponse[JsonNode] {.raises: [Exception].} =
return callPrivateRPC("banUserFromCommunity".prefix, %*[{
"communityId": communityId,
"user": pubKey
}])
proc setCommunityMuted*(communityId: string, muted: bool): RpcResponse[JsonNode] {.raises: [Exception].} =
return callPrivateRPC("setCommunityMuted".prefix, %*[communityId, muted])