Skip to content

Commit

Permalink
fix: don't log system comments on hash update
Browse files Browse the repository at this point in the history
  • Loading branch information
wescopeland committed Jan 5, 2025
1 parent dac2da2 commit c689787
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions app/Filament/Resources/GameResource/Pages/Hashes.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ public function table(Table $table): Table
$changedAttributes[$key] = $value;
}
}

$this->logGameHashUpdate(
$record,
$changedAttributes,
Auth::user()
);
}),
]),

Expand Down Expand Up @@ -194,34 +188,4 @@ public function table(Table $table): Table
])
->paginated(false);
}

/**
* @deprecated migrate everything to the activitylog
*/
private function logGameHashUpdate(GameHash $gameHash, array $changedAttributes, User $user): void
{
$commentParts = ["{$gameHash->md5} updated by {$user->User}."];

foreach ($changedAttributes as $attribute => $newValue) {
$newValueDisplay = $newValue ?? 'None';

switch ($attribute) {
case 'Name':
$commentParts[] = "File Name: \"{$newValueDisplay}\".";
break;
case 'Labels':
$commentParts[] = "Label: \"{$newValueDisplay}\".";
break;
case 'patch_url':
$commentParts[] = $newValue ? "RAPatches URL updated to: {$newValue}." : "RAPatches URL removed.";
break;
case 'source':
$commentParts[] = $newValue ? "Resource Page URL updated to: {$newValue}." : "Resource Page URL removed.";
break;
}
}

$comment = implode(' ', $commentParts);
addArticleComment("Server", ArticleType::GameHash, $gameHash->game_id, $comment);
}
}

0 comments on commit c689787

Please sign in to comment.