fetch the full name of a contact from the poco fields (if present)
This commit is contained in:
parent
4704933b6e
commit
e36627c7b7
1 changed files with 14 additions and 4 deletions
|
@ -670,6 +670,7 @@ function probe_url($url, $mode = PROBE_NORMAL) {
|
||||||
$vcard['fn'] = trim(unxmlify($author->get_email()));
|
$vcard['fn'] = trim(unxmlify($author->get_email()));
|
||||||
if(strpos($vcard['fn'],'@') !== false)
|
if(strpos($vcard['fn'],'@') !== false)
|
||||||
$vcard['fn'] = substr($vcard['fn'],0,strpos($vcard['fn'],'@'));
|
$vcard['fn'] = substr($vcard['fn'],0,strpos($vcard['fn'],'@'));
|
||||||
|
|
||||||
$email = unxmlify($author->get_email());
|
$email = unxmlify($author->get_email());
|
||||||
if(! $profile && $author->get_link())
|
if(! $profile && $author->get_link())
|
||||||
$profile = trim(unxmlify($author->get_link()));
|
$profile = trim(unxmlify($author->get_link()));
|
||||||
|
@ -681,6 +682,15 @@ function probe_url($url, $mode = PROBE_NORMAL) {
|
||||||
$vcard['photo'] = $elems['link'][0]['attribs']['']['href'];
|
$vcard['photo'] = $elems['link'][0]['attribs']['']['href'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Fetch fullname via poco:displayName
|
||||||
|
$pocotags = $feed->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
|
||||||
|
if ($pocotags) {
|
||||||
|
$elems = $pocotags[0]['child']['http://portablecontacts.net/spec/1.0'];
|
||||||
|
if (isset($elems["displayName"]))
|
||||||
|
$vcard['fn'] = $elems["displayName"][0]["data"];
|
||||||
|
if (isset($elems["preferredUsername"]))
|
||||||
|
$vcard['nick'] = $elems["preferredUsername"][0]["data"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$item = $feed->get_item(0);
|
$item = $feed->get_item(0);
|
||||||
|
@ -757,18 +767,18 @@ function probe_url($url, $mode = PROBE_NORMAL) {
|
||||||
$vcard['fn'] = $url;
|
$vcard['fn'] = $url;
|
||||||
|
|
||||||
if (($notify != "") AND ($poll != "")) {
|
if (($notify != "") AND ($poll != "")) {
|
||||||
$baseurl = matching($notify, $poll);
|
$baseurl = matching(normalise_link($notify), normalise_link($poll));
|
||||||
|
|
||||||
$baseurl2 = matching($baseurl, $profile);
|
$baseurl2 = matching($baseurl, normalise_link($profile));
|
||||||
if ($baseurl2 != "")
|
if ($baseurl2 != "")
|
||||||
$baseurl = $baseurl2;
|
$baseurl = $baseurl2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($baseurl == "") AND ($notify != ""))
|
if (($baseurl == "") AND ($notify != ""))
|
||||||
$baseurl = matching($profile, $notify);
|
$baseurl = matching(normalise_link($profile), normalise_link($notify));
|
||||||
|
|
||||||
if (($baseurl == "") AND ($poll != ""))
|
if (($baseurl == "") AND ($poll != ""))
|
||||||
$baseurl = matching($profile, $poll);
|
$baseurl = matching(normalise_link($profile), normalise_link($poll));
|
||||||
|
|
||||||
$baseurl = rtrim($baseurl, "/");
|
$baseurl = rtrim($baseurl, "/");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue