diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-08-06 23:57:28 +0200 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-08-06 23:57:28 +0200 |
commit | 07cd0c870f48ec838c23fa7c6966ceb1c41f06ab (patch) | |
tree | 26a1177441c40c2d3e42d3fc3617302dc2d86f12 /include/follow.php | |
parent | 2b1e6723168665039cdccb951e29c4220351367a (diff) | |
parent | 1b0cb9388cd5c416af5ba270127b14efdd1c0a6b (diff) | |
download | volse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.tar.gz volse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.tar.bz2 volse-hubzilla-07cd0c870f48ec838c23fa7c6966ceb1c41f06ab.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/follow.php')
-rw-r--r-- | include/follow.php | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/include/follow.php b/include/follow.php index 9430feac6..960138743 100644 --- a/include/follow.php +++ b/include/follow.php @@ -129,19 +129,6 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) } } else { - if(! ($is_http)) { - if(! intval(get_config('system','diaspora_enabled'))) { - $result['message'] = t('Protocol disabled.'); - return $result; - } - - $allowed = get_pconfig($uid,'system','diaspora_allowed'); - - if(! intval($allowed)) { - $result['message'] = t('Protocol blocked for this channel.'); - return $result; - } - } $their_perms = 0; $xchan_hash = ''; @@ -158,8 +145,15 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) } elseif($is_http) { $r = discover_by_url($url); + $r['allowed'] = intval(get_config('system','feed_contacts')); } if($r) { + $r['channel_id'] = $uid; + call_hooks('follow_allow',$r); + if(! $r['allowed']) { + $result['message'] = t('Protocol disabled.'); + return $result; + } $r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s' limit 1", dbesc($url), dbesc($url) @@ -199,10 +193,6 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) if($is_http) { - if(! intval(get_config('system','feed_contacts'))) { - $result['message'] = t('Protocol disabled.'); - return $result; - } $r = q("select count(*) as total from abook where abook_account = %d and abook_feed = 1 ", intval($aid) @@ -261,8 +251,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) ); if($r) { $result['abook'] = $r[0]; - if($is_red) - proc_run('php', 'include/notifier.php', 'permission_update', $result['abook']['abook_id']); + proc_run('php', 'include/notifier.php', 'permission_update', $result['abook']['abook_id']); } $arr = array('channel_id' => $uid, 'abook' => $result['abook']); |