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;
return $fetched_contact;
}
$url = $apcontact['url'];
+ } elseif (empty(parse_url($url, PHP_URL_PATH))) {
+ $apcontact['baseurl'] = $url;
}
// Detect multiple fast repeating request to the same address
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;
+ }
}