Add isExternal method to PeerAddress class

This commit is contained in:
netkas 2025-01-14 15:45:02 -05:00
parent 34b31c58a8
commit 1cab09b675

View file

@ -71,6 +71,21 @@
return $this->username === ReservedUsernames::HOST->value && $this->domain === Configuration::getInstanceConfiguration()->getDomain(); return $this->username === ReservedUsernames::HOST->value && $this->domain === Configuration::getInstanceConfiguration()->getDomain();
} }
/**
* Determines if the peer is external.
*
* @return bool True if the peer is external, false otherwise.
*/
public function isExternal(): bool
{
if($this->isHost())
{
return false;
}
return $this->username === ReservedUsernames::HOST->value;
}
/** /**
* Returns whether the peer requires authentication, for example, the anonymous user does not require authentication * Returns whether the peer requires authentication, for example, the anonymous user does not require authentication
* *