Fix BaseReps handleAnomymous

This commit is contained in:
lgb
2023-05-01 13:13:53 +08:00
parent 544cef3723
commit 9ddafbad8a

View File

@@ -20,8 +20,11 @@ class BaseRepository
return [$field, $type];
}
protected function handleAnonymous($username, User $user, User $authenticator, Torrent $torrent = null)
protected function handleAnonymous($username, $user, User $authenticator, Torrent $torrent = null)
{
if (!$user) {
return "";
}
if($user->privacy == "strong" || ($torrent && $torrent->anonymous == 'yes' && $user->id == $torrent->owner)) {
//用户强私密,或者种子作者匿名而当前项作者刚好为种子作者
$anonymousText = nexus_trans('label.anonymous');