diff options
author | friendica <info@friendica.com> | 2012-10-31 16:55:19 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-10-31 16:55:19 -0700 |
commit | 62a8298b549c8985a7817be046d7e25cbaf17cb5 (patch) | |
tree | 1d2a3de819567e3121f2035a03db47fcc8ed6295 /include/follow.php | |
parent | fb173900a16938c3ab7f066e4909d50b9f764473 (diff) | |
download | volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.tar.gz volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.tar.bz2 volse-hubzilla-62a8298b549c8985a7817be046d7e25cbaf17cb5.zip |
starting on pinging the basic elements of federation and communication
Diffstat (limited to 'include/follow.php')
-rw-r--r-- | include/follow.php | 17 |
1 files changed, 7 insertions, 10 deletions
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) { |