From 21fcce96edd2eec31b865dd4dd33f6919cc9da86 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 5 Jan 2022 11:34:21 -0500 Subject: [PATCH] refactor(community): add missing community functions (#152) --- status/statusgo_backend_new/communities.nim | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/status/statusgo_backend_new/communities.nim b/status/statusgo_backend_new/communities.nim index 573ddad..8f96b00 100644 --- a/status/statusgo_backend_new/communities.nim +++ b/status/statusgo_backend_new/communities.nim @@ -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]) \ No newline at end of file