Merge pull request #3673 from annando/contact-updating

Better updating of contacts
This commit is contained in:
Tobias Diekershoff 2017-08-30 22:34:01 +02:00 committed by GitHub
commit 65f1bcb780
2 changed files with 74 additions and 28 deletions

View file

@ -2200,22 +2200,14 @@ function update_gcontact($contact) {
$contact["updated"] = dbm::date();
}
if ($contact["network"] == NETWORK_TWITTER) {
$contact["server_url"] = 'http://twitter.com';
}
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"]);