diff --git a/config.nims b/config.nims index 27a5d0b..c0b0096 100644 --- a/config.nims +++ b/config.nims @@ -5,3 +5,6 @@ for dir in walkDir(thisDir() / "vendor"): if dir.kind == pcDir: switch("path", dir.path) switch("path", dir.path / "src") + +switch("path", thisDir() / "vendor/libchat/nim-bindings") +switch("path", thisDir() / "vendor/libchat/nim-bindings/src") \ No newline at end of file diff --git a/nim_chat_poc.nimble b/nim_chat_poc.nimble index 04eaf01..c10c360 100644 --- a/nim_chat_poc.nimble +++ b/nim_chat_poc.nimble @@ -21,6 +21,7 @@ requires "nim >= 2.2.4", "regex", "web3", "https://github.com/jazzz/nim-sds#exports", + "libchat", "waku", "ffi" diff --git a/src/chat/client.nim b/src/chat/client.nim index 5b796f9..b2c160e 100644 --- a/src/chat/client.nim +++ b/src/chat/client.nim @@ -49,8 +49,8 @@ type KeyEntry* = object timestamp: int64 type ChatClient* = ref object - ident: Identity libchatCtx: LibChat + ident: Identity ds*: WakuClient keyStore: Table[string, KeyEntry] # Keyed by HexEncoded Public Key conversations: Table[string, Conversation] # Keyed by conversation ID @@ -79,6 +79,7 @@ proc newClient*(ds: WakuClient, ident: Identity): ChatClient {.raises: [IOError, var c = ChatClient(ident: ident, var c = ChatClient( libchatCtx: newConversationsContext(), + ident: ident, ds: ds, keyStore: initTable[string, KeyEntry](), conversations: initTable[string, Conversation](), diff --git a/vendor/libchat b/vendor/libchat index 1e6a3ed..a1008ec 160000 --- a/vendor/libchat +++ b/vendor/libchat @@ -1 +1 @@ -Subproject commit 1e6a3edd798cdaa353012a2165f25891c80f4cf4 +Subproject commit a1008ec9694f86ff4f9e37f4c5b1a3dc510dc51f