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