Skip to content

Commit

Permalink
Merge pull request #10349 from nanaya/pin-check-type
Browse files Browse the repository at this point in the history
Disable pinning solo score when it's hidden
  • Loading branch information
notbakaneko authored Jul 7, 2023
2 parents 709c8b4 + 049cb8c commit 708f7f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Libraries/OsuAuthorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,10 @@ public function checkScorePin(?User $user, ScoreBest|Solo\Score $score): string
return $prefix.'not_owner';
}

if ($score instanceof Solo\Score && config('osu.user.hide_pinned_solo_scores')) {
return $prefix.'disabled_type';
}

$pinned = $user->scorePins()->forRuleset($score->getMode())->withVisibleScore()->count();

if ($pinned >= $user->maxScorePins()) {
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en/authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@

'score' => [
'pin' => [
'disabled_type' => "Can't pin this type of score",
'not_owner' => 'Only score owner can pin score.',
'too_many' => 'Pinned too many scores.',
],
Expand Down

0 comments on commit 708f7f8

Please sign in to comment.