Add libchat

This commit is contained in:
Jazz Turner-Baggs 2026-02-08 10:31:50 -08:00
parent 28c292d0db
commit 994eea9702
No known key found for this signature in database
4 changed files with 7 additions and 2 deletions

View File

@ -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")

View File

@ -21,6 +21,7 @@ requires "nim >= 2.2.4",
"regex",
"web3",
"https://github.com/jazzz/nim-sds#exports",
"libchat",
"waku",
"ffi"

View File

@ -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](),

2
vendor/libchat vendored

@ -1 +1 @@
Subproject commit 1e6a3edd798cdaa353012a2165f25891c80f4cf4
Subproject commit a1008ec9694f86ff4f9e37f4c5b1a3dc510dc51f