Skip to content

Commit

Permalink
Fix wrong parameter being passed to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Feb 17, 2024
1 parent b084e0b commit 3eb15e3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Automod/Automod.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace App\Automod;

use App\Automod\ModAction\ModAction;
use App\Context\Context;
use App\Dto\Model\LocalUser;
use App\Enum\FurtherAction;
use App\Enum\RunConfiguration;
Expand All @@ -29,7 +30,7 @@ public function analyze(
PostView|CommentView|Person|CommentReportView|PostReportView|RegistrationApplicationView|LocalUser $object
): void {
$furtherAction = FurtherAction::CanContinue;
$previousActions = [];
$context = new Context();

foreach ($this->actions as $action) {
if ($furtherAction !== FurtherAction::CanContinue && $action->getRunConfiguration() !== RunConfiguration::Always) {
Expand All @@ -38,8 +39,7 @@ public function analyze(
if (!$action->shouldRun($object)) {
continue;
}
$furtherAction = $action->takeAction($object, $previousActions);
$previousActions[] = $action;
$furtherAction = $action->takeAction($object, $context);
}
}
}

0 comments on commit 3eb15e3

Please sign in to comment.