]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Admin/Federation.php
Merge pull request #11003 from annando/fix-api
[friendica.git] / src / Module / Admin / Federation.php
index 2a784343611a17f456c24b83172b4846b6add95f..65d0453d933f67e78113408bf2b66ceda3ec7496 100644 (file)
@@ -28,9 +28,9 @@ use Friendica\Module\BaseAdmin;
 
 class Federation extends BaseAdmin
 {
-       public static function content(array $parameters = [])
+       public function content(): string
        {
-               parent::content($parameters);
+               parent::content();
 
                // get counts on active federation systems this node is knowing
                // We list the more common systems by name. The rest is counted as "other"
@@ -85,7 +85,7 @@ class Federation extends BaseAdmin
                                } elseif (in_array($gserver['platform'], ['osada', 'mistpark', 'roadhouse', 'zap'])) {
                                        $version['version'] = $gserver['platform'] . ' ' . $version['version'];
                                } elseif (in_array($gserver['platform'], ['activityrelay', 'pub-relay', 'selective-relay', 'aoderelay'])) {
-                                               $version['version'] = $gserver['platform'] . '-' . $version['version'];
+                                       $version['version'] = $gserver['platform'] . '-' . $version['version'];
                                }
 
                                $versionCounts[] = $version;
@@ -133,12 +133,16 @@ class Federation extends BaseAdmin
                        } elseif ($platform == 'diaspora') {
                                $versionCounts = self::reformaDiasporaVersions($versionCounts);
                        } elseif ($platform == 'relay') {
-                               $versionCounts = self::reformaRelayVersions($versionCounts);
+                               $versionCounts = self::reformatRelayVersions($versionCounts);
                        } elseif (in_array($platform, ['funkwhale', 'mastodon', 'mobilizon', 'misskey'])) {
                                $versionCounts = self::removeVersionSuffixes($versionCounts);
                        }
 
-                       $versionCounts = self::sortVersion($versionCounts);
+                       if (!in_array($platform, ['other', 'relay', 'mistpark'])) {
+                               $versionCounts = self::sortVersion($versionCounts);
+                       } else {
+                               ksort($versionCounts);
+                       }
 
                        $gserver['platform'] = $systems[$platform]['name'];
 
@@ -302,7 +306,7 @@ class Federation extends BaseAdmin
         * @param array $versionCounts list of version numbers
         * @return array with cleaned version numbers
         */
-       private static function reformaRelayVersions(array $versionCounts)
+       private static function reformatRelayVersions(array $versionCounts)
        {
                $compacted = [];
                foreach ($versionCounts as $key => $value) {