diff options
author | redmatrix <git@macgirvin.com> | 2016-03-23 20:04:09 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-03-23 20:04:09 -0700 |
commit | 531710142c271bc4002e16345d3ccd5d3f1c83e2 (patch) | |
tree | dfbe7dbffeebe9fa4322956c22ae944f0288b4cc /include | |
parent | f200dd4395e1d0e2a6200844ec4827a943bf09ea (diff) | |
download | volse-hubzilla-531710142c271bc4002e16345d3ccd5d3f1c83e2.tar.gz volse-hubzilla-531710142c271bc4002e16345d3ccd5d3f1c83e2.tar.bz2 volse-hubzilla-531710142c271bc4002e16345d3ccd5d3f1c83e2.zip |
add hook to allow plugins to perform a follow activity from an activityfeed
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php index 879f8ea12..2884d8e52 100755 --- a/include/items.php +++ b/include/items.php @@ -3848,8 +3848,8 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $datarray = get_atom_elements($feed,$item,$author); if($contact['xchan_network'] === 'rss') { - $res['public_policy'] = 'specific'; - $res['comment_policy'] = 'none'; + $datarray['public_policy'] = 'specific'; + $datarray['comment_policy'] = 'none'; } if((! x($author,'author_name')) || ($author['author_is_feed'])) @@ -3911,8 +3911,8 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $datarray = get_atom_elements($feed,$item,$author); if($contact['xchan_network'] === 'rss') { - $res['public_policy'] = 'specific'; - $res['comment_policy'] = 'none'; + $datarray['public_policy'] = 'specific'; + $datarray['comment_policy'] = 'none'; } @@ -3932,6 +3932,16 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { $datarray['author_xchan'] = ''; + if(activity_match($datarray['verb'],ACTIVITY_FOLLOW) && $datarray['obj_type'] === ACTIVITY_OBJ_PERSON) { + $cb = array('item' => $datarray,'channel' => $importer, 'xchan' => null, 'author' => $author, 'caught' => false); + call_hooks('follow_from_feed',$cb); + if($cb['caught']) { + if($cb['return_code']) + http_status_exit($cb['return_code']); + continue; + } + } + if($author['author_link'] != $contact['xchan_url']) { $x = import_author_unknown(array('name' => $author['author_name'],'url' => $author['author_link'],'photo' => array('src' => $author['author_photo']))); if($x) |