Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/pingpong.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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())

)
Expand All @@ -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
)
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions examples/tui/tui.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down Expand Up @@ -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()


Expand Down
1 change: 0 additions & 1 deletion src/chat_sdk/client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import # Foreign
types

import #local
conversation_store,
conversations,
conversations/convo_impl,
crypto,
Expand Down
4 changes: 0 additions & 4 deletions src/chat_sdk/conversation_store.nim
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import std/[options, times]

import ./conversations/[convo_type, message]
import crypto
import identity
import proto_types
import types

type ConvoId = string
Expand Down
3 changes: 1 addition & 2 deletions src/chat_sdk/delivery/waku_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import
libp2p/peerid,
std/random,
stew/byteutils,
std/sequtils,
strformat,
waku/[
common/logging,
Expand All @@ -20,7 +19,7 @@ import
waku_filter_v2/client,
]

import ../utils, ../proto_types
import ../proto_types

logScope:
topics = "chat waku"
Expand Down
2 changes: 0 additions & 2 deletions src/chat_sdk/identity.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

import crypto
import utils
import results
import crypto


type
Expand Down
3 changes: 1 addition & 2 deletions src/chat_sdk/inbox.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import
crypto,
delivery/waku_client,
proto_types,
types,
utils
types

logScope:
topics = "chat inbox"
Expand Down
1 change: 0 additions & 1 deletion src/chat_sdk/links.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import base64
import chronicles
import chronos
import strformat
import strutils
Expand Down
2 changes: 1 addition & 1 deletion src/chat_sdk/utils.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import waku/waku_core
import std/[macros, random, times]
import std/[macros, times]
import blake2
import strutils

Expand Down
1 change: 0 additions & 1 deletion src/content_types/all.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import protobuf_serialization # This import is needed or th macro will not work
import protobuf_serialization/proto_parser
import results
import std/random
import strformat

import ../chat_sdk/proto_types
Expand Down
191 changes: 0 additions & 191 deletions src/dev.nim

This file was deleted.

1 change: 0 additions & 1 deletion src/naxolotl.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import naxolotl/[
naxolotl,
curve25519,
types,
errors
]

Expand Down
3 changes: 1 addition & 2 deletions src/naxolotl/chacha.nim
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import nim_chacha20_poly1305/[common, chacha20_poly1305, streaming, helpers, poly1305]
import nim_chacha20_poly1305/[common, chacha20_poly1305, poly1305]
import std/[sysrand]
import results
import strformat
import chronicles

import types
import errors
Expand Down
2 changes: 1 addition & 1 deletion src/naxolotl/naxolotl.nim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import curve25519
import results
import chronicles
import nim_chacha20_poly1305/[common,helpers]
import nim_chacha20_poly1305/common
import strformat
import strutils
import sequtils
Expand Down
Loading