]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/GServer.php
Don't perform a delivery to failing servers
[friendica.git] / src / Model / GServer.php
index e93c347627d5bd269f2b6a72418c71a50ab95acc..f68851af6826b945cdc25f392a7381a5636c7db8 100644 (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);
                        }
                }