Add isExternal method to PeerAddress class
This commit is contained in:
parent
34b31c58a8
commit
1cab09b675
1 changed files with 15 additions and 0 deletions
|
@ -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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue