From 62a8298b549c8985a7817be046d7e25cbaf17cb5 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 31 Oct 2012 16:55:19 -0700 Subject: starting on pinging the basic elements of federation and communication --- include/follow.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'include/follow.php') diff --git a/include/follow.php b/include/follow.php index 55b83820c..4c835c8a7 100644 --- a/include/follow.php +++ b/include/follow.php @@ -2,13 +2,11 @@ // -// Takes a $uid and a url/handle and adds a new contact -// Currently if the contact is DFRN, interactive needs to be true, to redirect to the -// dfrn_request page. +// Takes a $uid and a url/handle and adds a new channel -// Otherwise this can be used to bulk add statusnet contacts, twitter contacts, etc. // Returns an array // $return['success'] boolean true if successful +// $return['abook_id'] Address book ID if successful // $return['message'] error text if success is false. @@ -19,10 +17,6 @@ function new_contact($uid,$url,$interactive = false) { $a = get_app(); - // remove ajax junk, e.g. Twitter - - $url = str_replace('/#!/','/',$url); - if(! allowed_url($url)) { $result['message'] = t('Disallowed profile URL.'); return $result; @@ -33,14 +27,17 @@ function new_contact($uid,$url,$interactive = false) { return $result; } - $arr = array('url' => $url, 'contact' => array()); + $arr = array('url' => $url, 'channel' => array()); call_hooks('follow', $arr); if(x($arr['contact'],'name')) $ret = $arr['contact']; else - $ret = probe_url($url); + $ret = zot_probe_url($url); + + + if($ret['network'] === NETWORK_DFRN) { if($interactive) { -- cgit v1.2.3