mirror of
https://github.com/friendica/friendica
synced 2024-12-23 03:20:15 +00:00
Notify and alias will be fetched via OStatus
This commit is contained in:
parent
9521cdc18f
commit
358a9fd6fd
2 changed files with 18 additions and 6 deletions
|
@ -130,6 +130,14 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch)
|
||||||
if ($r AND !$onlyfetch) {
|
if ($r AND !$onlyfetch) {
|
||||||
// Update contact data
|
// Update contact data
|
||||||
|
|
||||||
|
$value = $xpath->query("atom:link[@rel='salmon']", $context)->item(0)->nodeValue;
|
||||||
|
if ($value != "")
|
||||||
|
$contact["notify"] = $value;
|
||||||
|
|
||||||
|
$value = $xpath->evaluate('atom:author/uri/text()', $context)->item(0)->nodeValue;
|
||||||
|
if ($value != "")
|
||||||
|
$contact["alias"] = $value;
|
||||||
|
|
||||||
$value = $xpath->evaluate('atom:author/poco:displayName/text()', $context)->item(0)->nodeValue;
|
$value = $xpath->evaluate('atom:author/poco:displayName/text()', $context)->item(0)->nodeValue;
|
||||||
if ($value != "")
|
if ($value != "")
|
||||||
$contact["name"] = $value;
|
$contact["name"] = $value;
|
||||||
|
@ -169,10 +177,9 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo: Addr
|
// @todo: Addr
|
||||||
update_gcontact(array("url" => $contact["url"], "network" => $contact["network"],
|
$contact["generation"] = 2;
|
||||||
"photo" => $author["author-avatar"], "name" => $contact["name"],
|
$contact["photo"] = $author["author-avatar"];
|
||||||
"nick" => $contact["nick"], "location" => $contact["location"],
|
update_gcontact($contact);
|
||||||
"about" => $contact["about"], "generation" => 2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return($author);
|
return($author);
|
||||||
|
|
|
@ -1109,6 +1109,11 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
|
||||||
//get the person's name
|
//get the person's name
|
||||||
$name = substr($tag,1);
|
$name = substr($tag,1);
|
||||||
|
|
||||||
|
// Sometimes the tag detection doesn't seem to work right
|
||||||
|
// This is some workaround
|
||||||
|
$nameparts = explode(" ", $name);
|
||||||
|
$name = $nameparts[0];
|
||||||
|
|
||||||
// Try to detect the contact in various ways
|
// Try to detect the contact in various ways
|
||||||
if ((strpos($name,'@')) || (strpos($name,'http://'))) {
|
if ((strpos($name,'@')) || (strpos($name,'http://'))) {
|
||||||
// Is it in format @user@domain.tld or @http://domain.tld/...?
|
// Is it in format @user@domain.tld or @http://domain.tld/...?
|
||||||
|
@ -1146,8 +1151,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
|
||||||
dbesc(normalise_link($probed["url"])));
|
dbesc(normalise_link($probed["url"])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (!$r) {
|
} else {
|
||||||
$newname = str_replace('_',' ',$name);
|
|
||||||
$r = false;
|
$r = false;
|
||||||
if (strrpos($name,'+')) {
|
if (strrpos($name,'+')) {
|
||||||
// Is it in format @nick+number?
|
// Is it in format @nick+number?
|
||||||
|
@ -1330,6 +1334,7 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//if there is an url for this persons profile
|
//if there is an url for this persons profile
|
||||||
if(isset($profile)) {
|
if(isset($profile)) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue