mirror of
https://github.com/logos-messaging/nim-chat-poc.git
synced 2026-01-08 00:53:08 +00:00
update deprecated functions
This commit is contained in:
parent
ba124a3739
commit
27f748399f
@ -38,7 +38,7 @@ proc main() {.async.} =
|
|||||||
# Wire Callbacks
|
# Wire Callbacks
|
||||||
saro.onNewMessage(proc(convo: Conversation, msg: ReceivedMessage) {.async.} =
|
saro.onNewMessage(proc(convo: Conversation, msg: ReceivedMessage) {.async.} =
|
||||||
echo " Saro <------ :: " & getContent(msg.content)
|
echo " Saro <------ :: " & getContent(msg.content)
|
||||||
await sleepAsync(5000)
|
await sleepAsync(5000.milliseconds)
|
||||||
discard await convo.sendMessage(saro.ds, initTextFrame("Ping").toContentFrame())
|
discard await convo.sendMessage(saro.ds, initTextFrame("Ping").toContentFrame())
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -52,11 +52,11 @@ proc main() {.async.} =
|
|||||||
|
|
||||||
raya.onNewMessage(proc(convo: Conversation,msg: ReceivedMessage) {.async.} =
|
raya.onNewMessage(proc(convo: Conversation,msg: ReceivedMessage) {.async.} =
|
||||||
echo fmt" ------> Raya :: from:{msg.sender} " & getContent(msg.content)
|
echo fmt" ------> Raya :: from:{msg.sender} " & getContent(msg.content)
|
||||||
await sleepAsync(500)
|
await sleepAsync(500.milliseconds)
|
||||||
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
|
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
|
||||||
await sleepAsync(800)
|
await sleepAsync(800.milliseconds)
|
||||||
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
|
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
|
||||||
await sleepAsync(500)
|
await sleepAsync(500.milliseconds)
|
||||||
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
|
discard await convo.sendMessage(raya.ds, initTextFrame("Pong" & $ri).toContentFrame())
|
||||||
inc ri
|
inc ri
|
||||||
)
|
)
|
||||||
@ -73,13 +73,13 @@ proc main() {.async.} =
|
|||||||
await saro.start()
|
await saro.start()
|
||||||
await raya.start()
|
await raya.start()
|
||||||
|
|
||||||
await sleepAsync(5000)
|
await sleepAsync(5.seconds)
|
||||||
|
|
||||||
# Perform OOB Introduction: Raya -> Saro
|
# Perform OOB Introduction: Raya -> Saro
|
||||||
let raya_bundle = raya.createIntroBundle()
|
let raya_bundle = raya.createIntroBundle()
|
||||||
discard await saro.newPrivateConversation(raya_bundle)
|
discard await saro.newPrivateConversation(raya_bundle)
|
||||||
|
|
||||||
await sleepAsync(20000) # Run for some time
|
await sleepAsync(20.seconds) # Run for some time
|
||||||
|
|
||||||
saro.stop()
|
saro.stop()
|
||||||
raya.stop()
|
raya.stop()
|
||||||
|
|||||||
@ -490,7 +490,7 @@ proc appLoop(app: ChatApp, panes: seq[Pane]) : Future[void] {.async.} =
|
|||||||
illwillInit(fullscreen = false)
|
illwillInit(fullscreen = false)
|
||||||
# Clear buffer
|
# Clear buffer
|
||||||
while true:
|
while true:
|
||||||
await sleepAsync(5)
|
await sleepAsync(5.milliseconds)
|
||||||
app.tb.clear()
|
app.tb.clear()
|
||||||
|
|
||||||
drawStatusBar(app, panes[0], fgBlack, getIdColor(app.client.getId()))
|
drawStatusBar(app, panes[0], fgBlack, getIdColor(app.client.getId()))
|
||||||
@ -527,7 +527,7 @@ proc appLoop(app: ChatApp, panes: seq[Pane]) : Future[void] {.async.} =
|
|||||||
|
|
||||||
proc peerWatch(app: ChatApp): Future[void] {.async.} =
|
proc peerWatch(app: ChatApp): Future[void] {.async.} =
|
||||||
while true:
|
while true:
|
||||||
await sleepAsync(1000)
|
await sleepAsync(1.seconds)
|
||||||
app.peerCount = app.client.ds.getConnectedPeerCount()
|
app.peerCount = app.client.ds.getConnectedPeerCount()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user