From f2435ed4cdee6e20a92f2acfd60399cb92b2c1e3 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 21 Nov 2013 17:49:14 -0800 Subject: follow and accept_follow hooks --- mod/connections.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mod/connections.php') diff --git a/mod/connections.php b/mod/connections.php index ba5e8920e..d7adf775b 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -138,6 +138,8 @@ function connections_post(&$a) { group_add_member(local_user(),'',$a->data['abook_xchan'],$g['id']); } + + // Check if settings permit ("post new friend activity" is allowed, and // friends in general or this friend in particular aren't hidden) // and send out a new friend activity @@ -145,6 +147,7 @@ function connections_post(&$a) { // pull in a bit of content if there is any to pull in proc_run('php','include/onepoll.php',$contact_id); + } // Refresh the structure in memory with the new data @@ -159,6 +162,11 @@ function connections_post(&$a) { $a->data['abook'] = $r[0]; } + if($new_friend) { + $arr = array('channel_id' => local_user(), 'abook' => $a->data['abook']); + call_hooks('accept_follow', $arr); + } + connections_clone($a); return; -- cgit v1.2.3