From: Michael Date: Sun, 19 Nov 2023 19:11:45 +0000 (+0000) Subject: Simplify gserver entry creation for non native networks X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ba3dacdbde461aa1f16dd301f02d4ee11d575268;p=friendica.git Simplify gserver entry creation for non native networks --- diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 84d8dad8b6..aac3ccd9a4 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -81,7 +81,6 @@ class GServer const DETECT_MASTODON_API = 16; const DETECT_STATUS_PHP = 17; // Nextcloud const DETECT_V1_CONFIG = 18; - const DETECT_PUMPIO = 19; // Deprecated const DETECT_SYSTEM_ACTOR = 20; // Mistpark, Osada, Roadhouse, Zap // Standardized endpoints @@ -617,10 +616,14 @@ class GServer return false; } - $serverdata = self::parseNodeinfo210($curlResult); - if (empty($serverdata)) { - $curlResult = DI::httpClient()->get($url . '/.well-known/nodeinfo', HttpClientAccept::JSON); - $serverdata = self::fetchNodeinfo($url, $curlResult); + if (!empty($network) && !in_array($network, Protocol::NATIVE_SUPPORT)) { + $serverdata = ['detection-method' => self::DETECT_MANUAL, 'network' => $network, 'platform' => '', 'version' => '', 'site_name' => '', 'info' => '']; + } else { + $serverdata = self::parseNodeinfo210($curlResult); + if (empty($serverdata)) { + $curlResult = DI::httpClient()->get($url . '/.well-known/nodeinfo', HttpClientAccept::JSON); + $serverdata = self::fetchNodeinfo($url, $curlResult); + } } if ($only_nodeinfo && empty($serverdata)) {