+ if(! $profile)
+ $profile = $url;
+
+ // No human could be associated with this link, use the URL as the contact name
+
+ if(($network === NETWORK_FEED) && ($poll) && (! x($vcard,'fn')))
+ $vcard['fn'] = $url;
+
+ if (($notify != "") AND ($poll != "")) {
+ $baseurl = matching(normalise_link($notify), normalise_link($poll));
+
+ $baseurl2 = matching($baseurl, normalise_link($profile));
+ if ($baseurl2 != "")
+ $baseurl = $baseurl2;
+ }
+
+ if (($baseurl == "") AND ($notify != ""))
+ $baseurl = matching(normalise_link($profile), normalise_link($notify));
+
+ if (($baseurl == "") AND ($poll != ""))
+ $baseurl = matching(normalise_link($profile), normalise_link($poll));
+
+ $baseurl = rtrim($baseurl, "/");
+
+ if(strpos($url,'@') AND ($addr == "") AND ($network == NETWORK_DFRN))
+ $addr = str_replace('acct:', '', $url);
+
+ $vcard['fn'] = notags($vcard['fn']);
+ $vcard['nick'] = str_replace(' ','',notags($vcard['nick']));