example using crypto

This commit is contained in:
array-in-a-matrix 2024-02-15 12:09:10 -05:00
parent 6dbd2e5546
commit 7dd8b317ae
2 changed files with 8 additions and 3 deletions

4
.gitignore vendored
View file

@ -140,8 +140,10 @@ config.json
# matrix bot storage
storage.json
cryptoStorage
# compiled nim output
*.js
tests/credentials.nim
# ignore test account info
tests/credentials.nim

View file

@ -1,10 +1,13 @@
import ../src/nimbotsdk/[matrixTypes, MatrixClient, AutojoinRoomsMixin]
import ../src/nimbotsdk/[matrixTypes, MatrixClient, AutojoinRoomsMixin, SimpleFsStorageProvider, RustSdkCryptoStorageProvider]
const
homeserver: cstring = "https://matrix.example.xyz"
token: cstring = "token"
let client = newMatrixClient(homeserver, token)
let storage = newSimpleFsStorageProvider("storeage.json")
let cryptoStorage = newRustSdkCryptoStorageProvider("./cryptoStorage/")
let client = newMatrixClient(homeserver, token, storage, cryptoStorage)
AutojoinRoomsMixinSetupOnClient(client)