diff --git a/src/bot.ts b/src/bot.ts index 4969b885fca68c194884d630c0b67d0d2346f9dc..e96fac5cfbeede86a7b79a0e72cab1ba0a0a7c8b 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -94,7 +94,7 @@ export class DiscordBot { this.clientFactory = new DiscordClientFactory(store, config.auth); this.discordMsgProcessor = new DiscordMessageProcessor(config.bridge.domain, this); this.presenceHandler = new PresenceHandler(this); - this.roomHandler = new MatrixRoomHandler(this, config, this.provisioner, bridge, store.roomStore); + this.roomHandler = new MatrixRoomHandler(this, config, bridge, store.roomStore); this.channelSync = new ChannelSyncroniser(bridge, config, this, store.roomStore); this.provisioner = new Provisioner(store.roomStore, this.channelSync); this.mxEventProcessor = new MatrixEventProcessor( diff --git a/src/matrixroomhandler.ts b/src/matrixroomhandler.ts index 5a7c4b8c1d7c417b91655c0cb4eddd5b43fe5956..02e69f3d918e85cf4e25bf894733360203b76557 100644 --- a/src/matrixroomhandler.ts +++ b/src/matrixroomhandler.ts @@ -19,7 +19,6 @@ import { DiscordBridgeConfig } from "./config"; import * as Discord from "better-discord.js"; import { Util } from "./util"; -import { Provisioner } from "./provisioner"; import { Log } from "./log"; const log = new Log("MatrixRoomHandler"); import { DbRoomStore, MatrixStoreRoom, RemoteStoreRoom } from "./db/roomstore"; @@ -47,16 +46,12 @@ const JOIN_ROOM_SCHEDULE = [ export class MatrixRoomHandler { private botUserId: string; - private botJoinedRooms: Set<string>; // roomids - private botJoinedRoomsCacheUpdatedAt = 0; constructor( private discord: DiscordBot, private config: DiscordBridgeConfig, - private provisioner: Provisioner, private bridge: Appservice, private roomStore: DbRoomStore) { this.botUserId = this.discord.BotUserId; - this.botJoinedRooms = new Set(); } public bindThirdparty() { diff --git a/test/test_matrixroomhandler.ts b/test/test_matrixroomhandler.ts index 5a25d01313df589908e465820d661f6036691d29..eda53605aa82c643a1ec54669394486bc2af84f1 100644 --- a/test/test_matrixroomhandler.ts +++ b/test/test_matrixroomhandler.ts @@ -105,23 +105,6 @@ function createRH(opts: any = {}) { } else { config.bridge.enableSelfServiceBridging = true; } - const provisioner = { - AskBridgePermission: async () => { - if (opts.denyBridgePermission) { - throw new Error("The bridge has been declined by the Discord guild"); - } - }, - BridgeMatrixRoom: () => { - if (opts.failBridgeMatrix) { - throw new Error("Test failed matrix bridge"); - } - }, - UnbridgeRoom: async () => { - if (opts.failUnbridge) { - throw new Error("Test failed unbridge"); - } - }, - }; const store = { getEntriesByMatrixId: (matrixId) => { return [{ @@ -136,7 +119,7 @@ function createRH(opts: any = {}) { }, }; - const handler = new RoomHandler(bot as any, config, provisioner as any, bridge as any, store); + const handler = new RoomHandler(bot as any, config, bridge as any, store); return { handler, bridge }; }