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

@ -49,3 +49,12 @@ proc fetchAllMessagesFromChatsAndCommunitiesWhichMatchTerm*(communityIds: seq[st
searchTerm: string, caseSensitive: bool): RpcResponse[JsonNode] {.raises: [Exception].} =
let payload = %* [communityIds, chatIds, searchTerm, caseSensitive]
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)