From 531710142c271bc4002e16345d3ccd5d3f1c83e2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 23 Mar 2016 20:04:09 -0700 Subject: add hook to allow plugins to perform a follow activity from an activityfeed --- include/items.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'include/items.php') 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) -- cgit v1.2.3