diff --git a/src/Socialbox/Objects/PeerAddress.php b/src/Socialbox/Objects/PeerAddress.php index b603399..a2640fe 100644 --- a/src/Socialbox/Objects/PeerAddress.php +++ b/src/Socialbox/Objects/PeerAddress.php @@ -71,6 +71,21 @@ 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 *