X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Ffollow.php;h=e7693822abc17575d2f57a7aab67b944ecf4491d;hb=c2213760412f6d178d77451d69ae467534042457;hp=7a3514b3a73aa4942ca00f009cc6128361782461;hpb=d4c3dcf2fccefcb2c79881be09fd3b1c73dc611a;p=friendica.git diff --git a/include/follow.php b/include/follow.php index 7a3514b3a7..e7693822ab 100644 --- a/include/follow.php +++ b/include/follow.php @@ -77,12 +77,12 @@ function new_contact($uid,$url,$interactive = false) { $url = str_replace('/#!/','/',$url); - if(! allowed_url($url)) { + if (! allowed_url($url)) { $result['message'] = t('Disallowed profile URL.'); return $result; } - if(! $url) { + if (! $url) { $result['message'] = t('Connect URL missing.'); return $result; } @@ -91,17 +91,21 @@ function new_contact($uid,$url,$interactive = false) { call_hooks('follow', $arr); - if(x($arr['contact'],'name')) + if (x($arr['contact'],'name')) { $ret = $arr['contact']; - else + } + else { $ret = probe_url($url); + } - if($ret['network'] === NETWORK_DFRN) { - if($interactive) { - if(strlen($a->path)) - $myaddr = bin2hex($a->get_baseurl() . '/profile/' . $a->user['nickname']); - else + if ($ret['network'] === NETWORK_DFRN) { + if ($interactive) { + if (strlen($a->path)) { + $myaddr = bin2hex(App::get_baseurl() . '/profile/' . $a->user['nickname']); + } + else { $myaddr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname()); + } goaway($ret['request'] . "&addr=$myaddr"); @@ -254,7 +258,7 @@ function new_contact($uid,$url,$interactive = false) { intval($uid) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $result['message'] .= t('Unable to retrieve contact information.') . EOL; return $result; } @@ -289,8 +293,9 @@ function new_contact($uid,$url,$interactive = false) { $slap = ostatus::salmon($item, $r[0]); slapper($r[0], $contact['notify'], $slap); } + if ($contact['network'] == NETWORK_DIASPORA) { - $ret = diaspora::send_share($a->user,$contact); + $ret = Diaspora::send_share($a->user,$contact); logger('share returns: '.$ret); } }