Merge pull request #190 from matrix-org/gnuxie/mjolnir-overreact

Stop reacting to reports Mjolnir didn't send in report manager.
This commit is contained in:
Gnuxie 2022-01-18 17:40:56 +00:00 committed by GitHub
commit 6d911ab33b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,6 +142,11 @@ export class ReportManager {
let initialNoticeReport: IReport | undefined, confirmationReport: IReportWithAction | undefined;
try {
let originalEvent = await this.mjolnir.client.getEvent(roomId, relation.event_id);
if (originalEvent.sender !== await this.mjolnir.client.getUserId()) {
// Let's not handle reactions to events we didn't send as
// some setups have two or more Mjolnir's in the same management room.
return;
}
if (!("content" in originalEvent)) {
return;
}