Centralized gsid generation

This commit is contained in:
Michael 2020-05-22 10:10:24 +00:00
parent a77b7793a8
commit e27915a819
3 changed files with 10 additions and 14 deletions

View file

@ -1530,10 +1530,6 @@ class Contact
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
@ -2136,10 +2132,6 @@ class Contact
}
}
if (!empty($ret['baseurl']) && empty($contact['gsid'])) {
$ret['gsid'] = GServer::getID($ret['baseurl']);
}
$new_pubkey = $ret['pubkey'];
$update = false;
@ -2308,10 +2300,6 @@ class Contact
$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;