diff --git a/src/Mjolnir.ts b/src/Mjolnir.ts index 9e071b9e..1407bed7 100644 --- a/src/Mjolnir.ts +++ b/src/Mjolnir.ts @@ -183,7 +183,7 @@ export class Mjolnir { ) { this.protectedRoomsConfig = new ProtectedRoomsConfig(client); this.policyListManager = new PolicyListManager(this); - this.reactionHandler = new MatrixReactionHandler(this.managementRoomId, client); + this.reactionHandler = new MatrixReactionHandler(this.managementRoomId, client, clientUserId); const mutedModules = (LogService as any).mutedModules; if (!Array.isArray(mutedModules)) { diff --git a/src/commands/interface-manager/MatrixReactionHandler.ts b/src/commands/interface-manager/MatrixReactionHandler.ts index 5aca186f..d6ad9ae8 100644 --- a/src/commands/interface-manager/MatrixReactionHandler.ts +++ b/src/commands/interface-manager/MatrixReactionHandler.ts @@ -29,7 +29,11 @@ export class MatrixReactionHandler extends EventEmitter { /** * A client to lookup the related events to reactions. */ - private readonly client: MatrixSendClient + private readonly client: MatrixSendClient, + /** + * The user id of the client. Ignores reactions from this user + */ + private readonly clientUserId: string ) { super(); this.listener = this.handleEvent.bind(this); @@ -53,6 +57,9 @@ export class MatrixReactionHandler extends EventEmitter { if (relatesTo['rel_type'] !== 'm.annotation') { return; } + if (event['sender'] === this.clientUserId) { + return; + } const reactionKey = relatesTo['key']; const relatedEventId = relatesTo['event_id']; if (!(typeof relatedEventId === 'string' && typeof reactionKey === 'string')) {