mirror of
https://github.com/friendica/friendica
synced 2025-04-28 03:50:17 +00:00
Merge pull request #8678 from annando/gserver-detection-type
Improved server detection / gsid introduced
This commit is contained in:
commit
669124e72f
9 changed files with 492 additions and 115 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue