diff options
Diffstat (limited to 'mod/connections.php')
-rw-r--r-- | mod/connections.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mod/connections.php b/mod/connections.php index a40a8fa90..d7adf775b 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -129,6 +129,17 @@ function connections_post(&$a) { } if($new_friend) { + $channel = $a->get_channel(); + $default_group = $channel['channel_default_group']; + if($default_group) { + require_once('include/group.php'); + $g = group_rec_byhash(local_user(),$default_group); + if($g) + 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 @@ -136,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 @@ -150,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; |