From 45eade2218349f1d2446b6c1e96b21c6c7b55f7c Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Fri, 12 Nov 2021 13:33:47 +0100 Subject: [PATCH] refactor: mark all and mark certain messages as read methods added --- status/statusgo_backend_new/messages.nim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/status/statusgo_backend_new/messages.nim b/status/statusgo_backend_new/messages.nim index 28e8b76..88c1d98 100644 --- a/status/statusgo_backend_new/messages.nim +++ b/status/statusgo_backend_new/messages.nim @@ -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) \ No newline at end of file + 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) \ No newline at end of file