(1/?) e2e (doesnt work right now)

This commit is contained in:
2025-06-07 11:24:36 +08:00
parent a895d3c739
commit 0492705128
6 changed files with 23 additions and 8 deletions
+9 -4
View File
@@ -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
}
}
-1
View File
@@ -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")
+3 -2
View File
@@ -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
}