- $url = $orig_url = notags(trim($_POST['url']));
-
- $email_conversant = false;
-
- if($url) {
- $links = @lrdd($url);
- if(count($links)) {
- foreach($links as $link) {
- if($link['@attributes']['rel'] === NAMESPACE_DFRN)
- $dfrn = $link['@attributes']['href'];
- if($link['@attributes']['rel'] === 'salmon')
- $notify = $link['@attributes']['href'];
- if($link['@attributes']['rel'] === NAMESPACE_FEED)
- $poll = $link['@attributes']['href'];
- if($link['@attributes']['rel'] === 'http://microformats.org/profile/hcard')
- $hcard = $link['@attributes']['href'];
- if($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page')
- $profile = $link['@attributes']['href'];
-
- }
-
- // Status.Net can have more than one profile URL. We need to match the profile URL
- // to a contact on incoming messages to prevent spam, and we won't know which one
- // to match. So in case of two, one of them is stored as an alias. Only store URL's
- // and not webfinger user@host aliases. If they've got more than two non-email style
- // aliases, let's hope we're lucky and get one that matches the feed author-uri because
- // otherwise we're screwed.
-
- foreach($links as $link) {
- if($link['@attributes']['rel'] === 'alias') {
- if(strpos($link['@attributes']['href'],'@') === false) {
- if(isset($profile)) {
- if($link['@attributes']['href'] !== $profile)
- $alias = $link['@attributes']['href'];
- }
- else
- $profile = $link['@attributes']['href'];
- }
- }
- }
- }
- else {
- if((strpos($orig_url,'@')) && validate_email($orig_url)) {
- $email_conversant = true;
- }
- }
- }
-
- // If we find a DFRN site, send our subscriber to the other person's
- // dfrn_request page and all the other details will get sorted.
-
- if(strlen($dfrn)) {
- $ret = scrape_dfrn($dfrn);
- if(is_array($ret) && x($ret,'dfrn-request')) {
- if(strlen($a->path))
- $myaddr = bin2hex($a->get_baseurl() . '/profile/' . $a->user['nickname']);
- else
- $myaddr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname());
-
- goaway($ret['dfrn-request'] . "&addr=$myaddr");
-
- // NOTREACHED
- }
- }