From e3389d6bfe4388e20427556c3eeec8ecefe43691 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+PascalPrecht@users.noreply.github.com> Date: Tue, 5 Oct 2021 22:33:35 +0200 Subject: [PATCH] fix(status/chat): extend editCommunityChannel API to accept `position` property (#52) This was missing and causes chat item positions in communities to be reset to 0. --- status/chat.nim | 4 ++-- status/statusgo_backend/chat.nim | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/status/chat.nim b/status/chat.nim index 43372db8edf..c9ce7531f8b 100644 --- a/status/chat.nim +++ b/status/chat.nim @@ -497,8 +497,8 @@ proc editCommunity*(self: ChatModel, id: string, name: string, description: stri proc createCommunityChannel*(self: ChatModel, communityId: string, name: string, description: string): Chat = result = status_chat.createCommunityChannel(communityId, name, description) -proc editCommunityChannel*(self: ChatModel, communityId: string, channelId: string, name: string, description: string, categoryId: string): Chat = - result = status_chat.editCommunityChannel(communityId, channelId, name, description, categoryId) +proc editCommunityChannel*(self: ChatModel, communityId: string, channelId: string, name: string, description: string, categoryId: string, position: int): Chat = + result = status_chat.editCommunityChannel(communityId, channelId, name, description, categoryId, position) proc deleteCommunityChat*(self: ChatModel, communityId: string, channelId: string) = status_chat.deleteCommunityChat(communityId, channelId) diff --git a/status/statusgo_backend/chat.nim b/status/statusgo_backend/chat.nim index 35ebb6d4803..bb288d9d5d5 100644 --- a/status/statusgo_backend/chat.nim +++ b/status/statusgo_backend/chat.nim @@ -337,7 +337,7 @@ proc createCommunityChannel*(communityId: string, name: string, description: str if rpcResult{"result"} != nil and rpcResult{"result"}.kind != JNull: result = rpcResult["result"]["chats"][0].toChat() -proc editCommunityChannel*(communityId: string, channelId: string, name: string, description: string, categoryId: string): Chat = +proc editCommunityChannel*(communityId: string, channelId: string, name: string, description: string, categoryId: string, position: int): Chat = let rpcResult = callPrivateRPC("editCommunityChat".prefix, %*[ communityId, channelId.replace(communityId, ""), @@ -358,7 +358,8 @@ proc editCommunityChannel*(communityId: string, channelId: string, name: string, # } # ] }, - "category_id": categoryId + "category_id": categoryId, + "position": position }]).parseJSON() if rpcResult{"error"} != nil: