From 2d1789b11c06ec14cfba393405f4a283d7d3f90b Mon Sep 17 00:00:00 2001 From: gnuxie Date: Tue, 6 Dec 2022 13:55:37 +0000 Subject: [PATCH] doc for matrix intent listener. --- src/appservice/MjolnirManager.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/appservice/MjolnirManager.ts b/src/appservice/MjolnirManager.ts index 0284d71..b2f1087 100644 --- a/src/appservice/MjolnirManager.ts +++ b/src/appservice/MjolnirManager.ts @@ -221,6 +221,13 @@ export class ManagedMjolnir { } } +/** + * This is used to listen for events intended for a single mjolnir that resides in the appservice. + * This exists entirely because the Mjolnir class was previously designed only to receive events + * from a syncing matrix-bot-sdk MatrixClient. Since appservices provide a transactional push + * api for all users on the appservice, almost the opposite of sync, we needed to create an + * interface for both. See `MatrixEmitter`. + */ export class MatrixIntentListener extends EventEmitter implements MatrixEmitter { constructor(private readonly mjolnirId: string) { super()