Don't perform a delivery to failing servers

This commit is contained in:
Michael 2022-12-19 09:30:56 +00:00
parent 86a486f62b
commit feb74b4d9a
2 changed files with 15 additions and 5 deletions

View file

@ -177,9 +177,13 @@ class GServer
public static function reachable(string $profile, string $server = '', string $network = '', bool $force = false): bool
{
if ($server == '') {
$contact = Contact::getByURL($profile, null, ['baseurl']);
$contact = Contact::getByURL($profile, null, ['baseurl', 'network']);
if (!empty($contact['baseurl'])) {
$server = $contact['baseurl'];
} elseif ($contact['network'] == Protocol::DIASPORA) {
$parts = parse_url($profile);
unset($parts['path']);
$server = (string)Uri::fromParts($parts);
}
}