Attempt at fixing issues with acting as a public tracker.

This commit is contained in:
flash 2023-10-06 21:42:46 +00:00
parent 1750e5693f
commit 69c78510ff

View file

@ -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 {