X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FAPContact.php;h=841c028909b65c56913487844ce767fcf00a502e;hb=073695b33c5f9c5d89d91958b09259c59e12dd98;hp=baa364e940636a4e1d39ea7e40cadd5fed0e7bdb;hpb=46fdd9893cb0faef6982b113c85507297fac86d5;p=friendica.git diff --git a/src/Model/APContact.php b/src/Model/APContact.php index baa364e940..841c028909 100644 --- a/src/Model/APContact.php +++ b/src/Model/APContact.php @@ -26,7 +26,6 @@ use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Logger; use Friendica\Core\System; use Friendica\Database\DBA; -use Friendica\Database\DBStructure; use Friendica\DI; use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\HTTPException; @@ -539,4 +538,28 @@ class APContact HTTPSignature::setInboxStatus($url, true, $shared); } + + /** + * Check if the apcontact is a relay account + * + * @param array $apcontact + * + * @return bool + */ + public static function isRelay(array $apcontact): bool + { + if ($apcontact['nick'] != 'relay') { + return false; + } + + if ($apcontact['type'] == 'Application') { + return true; + } + + if (in_array($apcontact['type'], ['Group', 'Service']) && is_null($apcontact['outbox'])) { + return true; + } + + return false; + } }