Attempt at fixing issues with acting as a public tracker.
This commit is contained in:
parent
1750e5693f
commit
69c78510ff
1 changed files with 4 additions and 3 deletions
|
@ -49,9 +49,10 @@ readonly class TorrentPeerInfo {
|
|||
return $this->userId !== null;
|
||||
}
|
||||
|
||||
public function verifyUser(UserInfo $userInfo): bool {
|
||||
return !$this->hasUserId()
|
||||
|| ($userInfo !== null && $userInfo->getId() === $this->userId);
|
||||
public function verifyUser(?UserInfo $userInfo): bool {
|
||||
return $this->userId === null
|
||||
? $userInfo === null
|
||||
: $this->userId === $userInfo->getId();
|
||||
}
|
||||
|
||||
public function getAddress(): string {
|
||||
|
|
Loading…
Reference in a new issue