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;
|
return $this->userId !== null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function verifyUser(UserInfo $userInfo): bool {
|
public function verifyUser(?UserInfo $userInfo): bool {
|
||||||
return !$this->hasUserId()
|
return $this->userId === null
|
||||||
|| ($userInfo !== null && $userInfo->getId() === $this->userId);
|
? $userInfo === null
|
||||||
|
: $this->userId === $userInfo->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAddress(): string {
|
public function getAddress(): string {
|
||||||
|
|
Loading…
Reference in a new issue