This commit is contained in:
2026-03-20 21:17:26 +01:00
parent 1a62fcb81d
commit 29c3ff8572
229 changed files with 13147 additions and 2577 deletions

View File

@@ -7,6 +7,7 @@ namespace App\Observers;
use App\Models\ArtworkComment;
use App\Services\UserStatsService;
use App\Services\UserMentionSyncService;
use App\Services\XPService;
use Illuminate\Support\Facades\DB;
/**
@@ -18,6 +19,7 @@ class ArtworkCommentObserver
public function __construct(
private readonly UserStatsService $userStats,
private readonly UserMentionSyncService $mentionSync,
private readonly XPService $xp,
) {}
public function created(ArtworkComment $comment): void
@@ -30,6 +32,7 @@ class ArtworkCommentObserver
// The commenter is "active"
$this->userStats->ensureRow($comment->user_id);
$this->userStats->setLastActiveAt($comment->user_id);
$this->xp->awardCommentCreated((int) $comment->user_id, (int) $comment->id, 'artwork');
$this->mentionSync->syncForComment($comment);
}