Improved server detection / new servers added to federation statistics (#13793)

* Improved server detection / new servers added to federation statistics

* Fix wrong color code
This commit is contained in:
Michael Vogel 2024-01-02 20:12:37 +01:00 committed by GitHub
parent bf80001c80
commit 9592292dba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 2 deletions

View file

@ -1247,6 +1247,11 @@ class GServer
}
}
// Special treatment for NextCloud, since there you can freely define your software name
if (!empty($nodeinfo['rootUrl']) && in_array(parse_url($nodeinfo['rootUrl'], PHP_URL_PATH), ['/index.php/apps/social', '/apps/social'])) {
$server['platform'] = 'nextcloud';
}
if (!empty($nodeinfo['metadata']['nodeName'])) {
$server['site_name'] = $nodeinfo['metadata']['nodeName'];
}
@ -1565,7 +1570,7 @@ class GServer
}
foreach ($tags as $tag) {
if ((($tag['as:name'] ?? '') == 'Protocol') && (($tag['sc:value'] ?? '') == 'nomad')) {
if ((($tag['as:name'] ?? '') == 'Protocol') && in_array('nomad', [$tag['sc:value'] ?? '', $tag['as:content'] ?? ''])) {
return true;
}
}