mirror of
https://github.com/status-im/status-lib.git
synced 2025-02-18 07:16:40 +00:00
refactor: search for messages which match a patter
Two convenient methods added to search for the messages which match a pattern. Search is applied on the chat with passed id or across communities and/or chats with passed ids.
This commit is contained in:
parent
cdaea151d9
commit
a07dc86b8a
@ -38,4 +38,14 @@ proc fetchMessageByMessageId*(messageId: string): RpcResponse[JsonNode] {.raises
|
|||||||
|
|
||||||
proc fetchReactionsForMessageWithId*(chatId: string, messageId: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
proc fetchReactionsForMessageWithId*(chatId: string, messageId: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||||
let payload = %* [chatId, messageId]
|
let payload = %* [chatId, messageId]
|
||||||
result = callPrivateRPC("emojiReactionsByChatIDMessageID".prefix, payload)
|
result = callPrivateRPC("emojiReactionsByChatIDMessageID".prefix, payload)
|
||||||
|
|
||||||
|
proc fetchAllMessagesFromChatWhichMatchTerm*(chatId: string, searchTerm: string, caseSensitive: bool):
|
||||||
|
RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||||
|
let payload = %* [chatId, searchTerm, caseSensitive]
|
||||||
|
result = callPrivateRPC("allMessagesFromChatWhichMatchTerm".prefix, payload)
|
||||||
|
|
||||||
|
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)
|
Loading…
x
Reference in New Issue
Block a user