mirror of
https://github.com/status-im/status-lib.git
synced 2025-02-02 23:53:23 +00:00
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.
This commit is contained in:
parent
964e52c742
commit
e3389d6bfe
@ -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 =
|
proc createCommunityChannel*(self: ChatModel, communityId: string, name: string, description: string): Chat =
|
||||||
result = status_chat.createCommunityChannel(communityId, name, description)
|
result = status_chat.createCommunityChannel(communityId, name, description)
|
||||||
|
|
||||||
proc editCommunityChannel*(self: ChatModel, communityId: string, channelId: string, name: string, description: string, categoryId: string): Chat =
|
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)
|
result = status_chat.editCommunityChannel(communityId, channelId, name, description, categoryId, position)
|
||||||
|
|
||||||
proc deleteCommunityChat*(self: ChatModel, communityId: string, channelId: string) =
|
proc deleteCommunityChat*(self: ChatModel, communityId: string, channelId: string) =
|
||||||
status_chat.deleteCommunityChat(communityId, channelId)
|
status_chat.deleteCommunityChat(communityId, channelId)
|
||||||
|
@ -337,7 +337,7 @@ proc createCommunityChannel*(communityId: string, name: string, description: str
|
|||||||
if rpcResult{"result"} != nil and rpcResult{"result"}.kind != JNull:
|
if rpcResult{"result"} != nil and rpcResult{"result"}.kind != JNull:
|
||||||
result = rpcResult["result"]["chats"][0].toChat()
|
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, %*[
|
let rpcResult = callPrivateRPC("editCommunityChat".prefix, %*[
|
||||||
communityId,
|
communityId,
|
||||||
channelId.replace(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()
|
}]).parseJSON()
|
||||||
|
|
||||||
if rpcResult{"error"} != nil:
|
if rpcResult{"error"} != nil:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user