send message instead of rpc request

This commit is contained in:
Iuri Matias 2020-05-13 15:14:35 -04:00
parent c258b7c746
commit a9e84c685d
1 changed files with 21 additions and 1 deletions

View File

@ -1,7 +1,9 @@
import NimQml
import applicationView
import chats
import json
import state
import status/utils
import status/core as status
import status/test as status_test
@ -29,7 +31,25 @@ proc mainProc() =
# result.accountResult = status.queryAccounts()
let logic = newApplicationView(app, status.callPrivateRPC)
var sendMessage = proc (msg: string): string =
let payload = %* {
"jsonrpc": "2.0",
"id": 40,
"method": "sendChatMessage".prefix,
"params": [
{
"chatId": "test",
"text": msg,
"responseTo": nil,
"ensName": nil,
"sticker": nil,
"contentType": 1
}
]
}
status.callPrivateRPC($payload)
let logic = newApplicationView(app, sendMessage)
defer: logic.delete
let logicVariant = newQVariant(logic)