Better updating of contacts

This commit is contained in:
Michael 2017-08-30 18:05:41 +00:00
parent 0fa84d01b0
commit 0083c16e87
2 changed files with 54 additions and 28 deletions

View file

@ -2201,21 +2201,9 @@ function update_gcontact($contact) {
}
if ($contact["server_url"] == "") {
$server_url = $contact["url"];
$server_url = matching_url($server_url, $contact["alias"]);
if ($server_url != "") {
$contact["server_url"] = $server_url;
}
$server_url = matching_url($server_url, $contact["photo"]);
if ($server_url != "") {
$contact["server_url"] = $server_url;
}
$server_url = matching_url($server_url, $contact["notify"]);
if ($server_url != "") {
$contact["server_url"] = $server_url;
$data = Probe::uri($contact["url"]);
if ($data["network"] != NETWORK_PHANTOM) {
$contact["server_url"] = $data['baseurl'];
}
} else {
$contact["server_url"] = normalise_link($contact["server_url"]);