From 8797ea38734e0c2980c0426459ef08578325721a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 15 Sep 2022 02:29:46 +0200 Subject: [PATCH] Changes: - Parameter `$nodeinfo_url` was no longer present, instead an instance of `ICanHandleHttpResponses` is now given (documentation updated) - sorted a bit setting array values --- src/Model/GServer.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 8ead599408..8627b61e52 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -165,7 +165,6 @@ class GServer * @param string $pattern * * @return array - * * @throws Exception */ public static function listByDomainPattern(string $pattern): array @@ -290,7 +289,6 @@ class GServer * @param bool $undetected * * @return string - * * @throws Exception */ public static function getNextUpdateDate(bool $success, string $created = '', string $last_contact = '', bool $undetected = false): string @@ -813,6 +811,9 @@ class GServer } $serverdata['registered-users'] = $serverdata['registered-users'] ?? 0; + $serverdata['next_contact'] = self::getNextUpdateDate(true, '', '', in_array($serverdata['network'], [Protocol::PHANTOM, Protocol::FEED])); + $serverdata['last_contact'] = DateTimeFormat::utcNow(); + $serverdata['failed'] = false; // Numbers above a reasonable value (10 millions) are ignored if ($serverdata['registered-users'] > 10000000) { @@ -900,7 +901,6 @@ class GServer * @param string $server_url address of the server * * @return void - * * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ private static function discoverRelay(string $server_url) @@ -1392,10 +1392,9 @@ class GServer /** * Parses NodeInfo2 * - * @see https://github.com/jaywink/nodeinfo2 - * + * @param ICanHandleHttpResponses $httpResult * @return array Server data - * + * @see https://github.com/jaywink/nodeinfo2/blob/master/PROTOCOL.md * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ private static function parseNodeinfo2(ICanHandleHttpResponses $httpResult): array -- 2.39.5