refactor: mark all and mark certain messages as read methods added

This commit is contained in:
Sale Djenic 2021-11-12 13:33:47 +01:00 committed by saledjenic
parent a07dc86b8a
commit 45eade2218
1 changed files with 10 additions and 1 deletions

View File

@ -48,4 +48,13 @@ proc fetchAllMessagesFromChatWhichMatchTerm*(chatId: string, searchTerm: string,
proc fetchAllMessagesFromChatsAndCommunitiesWhichMatchTerm*(communityIds: seq[string], chatIds: seq[string],
searchTerm: string, caseSensitive: bool): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [communityIds, chatIds, searchTerm, caseSensitive]
result = callPrivateRPC("allMessagesFromChatsAndCommunitiesWhichMatchTerm".prefix, payload)
result = callPrivateRPC("allMessagesFromChatsAndCommunitiesWhichMatchTerm".prefix, payload)
proc markAllMessagesFromChatWithIdAsRead*(chatId: string): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [chatId]
result = callPrivateRPC("markAllRead".prefix, payload)
proc markCertainMessagesFromChatWithIdAsRead*(chatId: string, messageIds: seq[string]):
RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [chatId, messageIds]
result = callPrivateRPC("markMessagesSeen".prefix, payload)