"addr" and "server_url" are now generated directly in "update_gcontact" if not given.

This commit is contained in:
Michael Vogel
2016-02-14 11:56:23 +01:00
parent b9e1792076
commit 5d35974c19
3 changed files with 75 additions and 36 deletions
-20
View File
@@ -164,8 +164,6 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch)
update_contact_avatar($author["author-avatar"], $importer["uid"], $contact["id"]);
}
/// @todo Add the "addr" field
$contact["generation"] = 2;
$contact["photo"] = $author["author-avatar"];
update_gcontact($contact);
@@ -675,24 +673,6 @@ function ostatus_conv_fetch_actor($actor) {
}
}
$contact["server_url"] = $contact["url"];
$server_url = matching($contact["server_url"], $contact["alias"]);
if (strlen($server_url) > 8)
$contact["server_url"] = $server_url;
$server_url = matching($contact["server_url"], $contact["photo"]);
if (strlen($server_url) > 8)
$contact["server_url"] = $server_url;
if (($contact["server_url"] == $contact["url"]) OR ($contact["server_url"] == $contact["alias"]))
unset($contact["server_url"]);
else {
$hostname = str_replace("http://", "", normalise_link($contact["server_url"]));
if ($hostname AND $contact["nick"])
$contact["addr"] = $contact["nick"]."@".$hostname;
}
update_gcontact($contact);
}