diff --git a/status/statusgo_backend_new/chat.nim b/status/statusgo_backend_new/chat.nim index 438806a..b13c711 100644 --- a/status/statusgo_backend_new/chat.nim +++ b/status/statusgo_backend_new/chat.nim @@ -52,6 +52,31 @@ proc deactivateChat*(chatId: string): RpcResponse[JsonNode] {.raises: [Exception proc clearChatHistory*(chatId: string): RpcResponse[JsonNode] {.raises: [Exception].} = callPrivateRPC("deleteMessagesByChatID".prefix, %* [chatId]) +proc sendChatMessage*( + chatId: string, + msg: string, + replyTo: string, + contentType: int, + preferredUsername: string = "", + communityId: string = "", + stickerHash: string = "", + stickerPack: int = 0, + ): RpcResponse[JsonNode] {.raises: [Exception].} = + result = callPrivateRPC("sendChatMessage".prefix, %* [ + { + "chatId": chatId, + "text": msg, + "responseTo": replyTo, + "ensName": preferredUsername, + "sticker": { + "hash": stickerHash, + "pack": stickerPack + }, + "contentType": contentType, + "communityId": communityId + } + ]) + proc sendImages*(chatId: string, images: var seq[string]): RpcResponse[JsonNode] {.raises: [Exception].} = let imagesJson = %* images.map(image => %* { diff --git a/status/statusgo_backend_new/stickers.nim b/status/statusgo_backend_new/stickers.nim index 2558b37..9fc6c19 100644 --- a/status/statusgo_backend_new/stickers.nim +++ b/status/statusgo_backend_new/stickers.nim @@ -1,6 +1,5 @@ import json -import ../statusgo_backend_new/eth as eth - +import ./eth # Retrieves number of sticker packs owned by user # See https://notes.status.im/Q-sQmQbpTOOWCQcYiXtf5g#Read-Sticker-Packs-owned-by-a-user