if (empty($data)) {
$data = Probe::uri($url, "", $uid);
- // Ensure that there is a gserver entry
- if (!empty($data['baseurl']) && ($data['network'] != Protocol::PHANTOM)) {
- $data['gsid'] = GServer::getID($data['baseurl']);
- }
}
// Take the default values when probing failed
}
}
- if (!empty($ret['baseurl']) && empty($contact['gsid'])) {
- $ret['gsid'] = GServer::getID($ret['baseurl']);
- }
-
$new_pubkey = $ret['pubkey'];
$update = false;
$ret = Probe::uri($url, $network, $uid, false);
}
- if (!empty($ret['baseurl'])) {
- $ret['gsid'] = GServer::getID($ret['baseurl']);
- }
-
if (($network != '') && ($ret['network'] != $network)) {
Logger::log('Expected network ' . $network . ' does not match actual network ' . $ret['network']);
return $result;
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;
"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;
}
}
$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;
}
$profile['poll'] = $apcontact['outbox'];
$profile['pubkey'] = $apcontact['pubkey'];
$profile['baseurl'] = $apcontact['baseurl'];
+ $profile['gsid'] = $apcontact['gsid'];
// Remove all "null" fields
foreach ($profile as $field => $content) {