Merge pull request #8678 from annando/gserver-detection-type

Improved server detection / gsid introduced
This commit is contained in:
Hypolite Petovan 2020-05-22 10:25:37 -04:00 committed by GitHub
commit 669124e72f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 492 additions and 115 deletions

View file

@ -30,6 +30,7 @@ use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\GServer;
use Friendica\Model\Profile;
use Friendica\Protocol\ActivityNamespace;
use Friendica\Protocol\ActivityPub;
@ -86,14 +87,16 @@ class Probe
"community", "keywords", "location", "about", "hide",
"batch", "notify", "poll", "request", "confirm", "poco",
"following", "followers", "inbox", "outbox", "sharedinbox",
"priority", "network", "pubkey", "baseurl"];
"priority", "network", "pubkey", "baseurl", "gsid"];
$newdata = [];
foreach ($fields as $field) {
if (isset($data[$field])) {
$newdata[$field] = $data[$field];
} else {
} elseif ($field != "gsid") {
$newdata[$field] = "";
} else {
$newdata[$field] = null;
}
}
@ -461,6 +464,10 @@ class Probe
$data['baseurl'] = self::$baseurl;
}
if (!empty($data['baseurl']) && empty($data['gsid'])) {
$data['gsid'] = GServer::getID($data['baseurl']);
}
if (empty($data['network'])) {
$data['network'] = Protocol::PHANTOM;
}