(1/?) e2e (doesnt work right now)
This commit is contained in:
+9
-4
@@ -1,4 +1,6 @@
|
||||
import { AutojoinRoomsMixin, MatrixClient, SimpleFsStorageProvider } from "matrix-bot-sdk";
|
||||
import { AutojoinRoomsMixin, MatrixClient, SimpleFsStorageProvider, RustSdkCryptoStorageProvider } from "matrix-bot-sdk";
|
||||
import * as sdk from 'matrix-bot-sdk'
|
||||
|
||||
import Logger from "./util/Logger";
|
||||
import { StrawberryFilling } from "./types/Cheesecake";
|
||||
const csc = new Logger("Strawberry Cheesecake", 'red')
|
||||
@@ -9,15 +11,17 @@ var homeServer = process.env.homeserver
|
||||
|
||||
var accessToken: any = process.env.token
|
||||
var storage: SimpleFsStorageProvider
|
||||
var crypto: RustSdkCryptoStorageProvider
|
||||
|
||||
var client: MatrixClient = null;
|
||||
|
||||
export function BakeStrawberryCheesecake(): StrawberryFilling {
|
||||
client = null;
|
||||
csc.log('Baking strawberry cheesecake...')
|
||||
crypto = new RustSdkCryptoStorageProvider('./crypto1/')
|
||||
storage = new SimpleFsStorageProvider('session.json')
|
||||
cd.quiet('Started Matrix Client.')
|
||||
client = new MatrixClient(homeServer, accessToken, storage);
|
||||
client = new MatrixClient(homeServer, accessToken, storage, crypto);
|
||||
client.start()
|
||||
csc.log(`Baked strawberry cheesecake. Serving cake.`)
|
||||
AutojoinRoomsMixin.setupOnClient(client);
|
||||
@@ -28,8 +32,9 @@ export function BakeStrawberryCheesecake(): StrawberryFilling {
|
||||
export function GetStrawberryCheesecake(): StrawberryFilling {
|
||||
return {
|
||||
accessToken: accessToken,
|
||||
stomach: storage,
|
||||
cake: client
|
||||
stomach_session: storage,
|
||||
cake: client,
|
||||
stomach_crypto: crypto
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import { Cinnamon, CinnamonInit } from "./Cinnamon";
|
||||
import { BakeStrawberryCheesecake } from "./Cheesecake";
|
||||
import { StrawberryFilling } from "./types/Cheesecake";
|
||||
|
||||
|
||||
dotenv.config()
|
||||
export const cd = new Logger("DEBUGGER", 'cyan', `${new Date().toLocaleDateString('en-us').replaceAll('/', '-')}-DEBUG`)
|
||||
const cm = new Logger("CLIENT/index.ts")
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { MatrixClient, SimpleFsStorageProvider } from "matrix-bot-sdk";
|
||||
import { MatrixClient, RustSdkCryptoStorageProvider, SimpleFsStorageProvider } from "matrix-bot-sdk";
|
||||
|
||||
export interface StrawberryFilling {
|
||||
accessToken: string,
|
||||
stomach: SimpleFsStorageProvider,
|
||||
stomach_session: SimpleFsStorageProvider,
|
||||
stomach_crypto: RustSdkCryptoStorageProvider,
|
||||
cake: MatrixClient
|
||||
}
|
||||
Reference in New Issue
Block a user