Send new artwork uploads through a trust-based review policy.
Require review for untrusted accounts, add admin artwork review APIs, and keep queued or auto-trusted publishes from counting as established history.
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
namespace App\Services\Moderation;
|
||||
|
||||
use App\Data\Moderation\ModerationResultData;
|
||||
use App\Enums\ModerationEscalationStatus;
|
||||
use App\Enums\ModerationContentType;
|
||||
use App\Enums\ModerationEscalationStatus;
|
||||
use App\Enums\ModerationStatus;
|
||||
use App\Models\ContentModerationAiSuggestion;
|
||||
use App\Models\ContentModerationFinding;
|
||||
@@ -14,8 +14,7 @@ class ContentModerationPersistenceService
|
||||
public function __construct(
|
||||
private readonly ContentModerationReviewService $review,
|
||||
private readonly ContentModerationActionLogService $actionLogs,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function shouldQueue(ModerationResultData $result): bool
|
||||
{
|
||||
@@ -33,7 +32,7 @@ class ContentModerationPersistenceService
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
* @param array<string, mixed> $context
|
||||
* @return array{finding:?ContentModerationFinding, created:bool, updated:bool}
|
||||
*/
|
||||
public function persist(ModerationResultData $result, array $context): array
|
||||
@@ -56,7 +55,7 @@ class ContentModerationPersistenceService
|
||||
return ['finding' => null, 'created' => false, 'updated' => false];
|
||||
}
|
||||
|
||||
$finding = $existing ?? new ContentModerationFinding();
|
||||
$finding = $existing ?? new ContentModerationFinding;
|
||||
$isNew = ! $finding->exists;
|
||||
|
||||
$finding->fill([
|
||||
@@ -144,10 +143,16 @@ class ContentModerationPersistenceService
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $context
|
||||
* @param array<string, mixed> $context
|
||||
*/
|
||||
public function applyAutomatedActionIfNeeded(ContentModerationFinding $finding, ModerationResultData $result, array $context): bool
|
||||
{
|
||||
if (($context['comment_spam_mode'] ?? null) === 'observe') {
|
||||
$finding->forceFill(['auto_action_taken' => 'observe_only'])->save();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! $result->autoHideRecommended) {
|
||||
return false;
|
||||
}
|
||||
@@ -179,4 +184,4 @@ class ContentModerationPersistenceService
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user