Fix: 無限ループを抑制

This commit is contained in:
Chocolate Pie 2023-07-28 12:11:25 +09:00
parent 3b1d9e0285
commit 63359f5fc4
1 changed files with 3 additions and 3 deletions

View File

@ -76,16 +76,16 @@ export class ReportAbuseProcessorService {
const isReportContentPatternMatched = resolver.reportContentPattern ? new RE2(resolver.reportContentPattern).test(job.data.comment) : true; const isReportContentPatternMatched = resolver.reportContentPattern ? new RE2(resolver.reportContentPattern).test(job.data.comment) : true;
if (isTargetUserPatternMatched && isReporterPatternMatched && isReportContentPatternMatched) { if (isTargetUserPatternMatched && isReporterPatternMatched && isReportContentPatternMatched) {
if (resolver.forward && job.data.targetUserHost !== null) { if (resolver.forward && job.data.targetUserHost !== null && job.data.reporterHost === null) {
this.queueService.deliver(actor, this.apRendererService.addContext(this.apRendererService.renderFlag(actor, targetUser.uri!, job.data.comment)), targetUser.inbox, false); this.queueService.deliver(actor, this.apRendererService.addContext(this.apRendererService.renderFlag(actor, targetUser.uri!, job.data.comment)), targetUser.inbox, false);
} }
await this.abuseUserReportsRepository.update(job.data.id, { await this.abuseUserReportsRepository.update(job.data.id, {
resolved: true, resolved: true,
assigneeId: actor.id, assigneeId: actor.id,
forwarded: resolver.forward && job.data.targetUserHost !== null, forwarded: resolver.forward && job.data.targetUserHost !== null && job.data.reporterHost === null,
}); });
return; return;
} }
} }