follow and accept_follow hooks
This commit is contained in:
parent
8cdbd0e2a6
commit
f2435ed4cd
@ -175,6 +175,10 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
|
|||||||
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']);
|
||||||
|
|
||||||
|
call_hooks('follow', $arr);
|
||||||
|
|
||||||
/** If there is a default group for this channel, add this member to it */
|
/** If there is a default group for this channel, add this member to it */
|
||||||
|
|
||||||
if($default_group) {
|
if($default_group) {
|
||||||
|
@ -138,6 +138,8 @@ function connections_post(&$a) {
|
|||||||
group_add_member(local_user(),'',$a->data['abook_xchan'],$g['id']);
|
group_add_member(local_user(),'',$a->data['abook_xchan'],$g['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Check if settings permit ("post new friend activity" is allowed, and
|
// Check if settings permit ("post new friend activity" is allowed, and
|
||||||
// friends in general or this friend in particular aren't hidden)
|
// friends in general or this friend in particular aren't hidden)
|
||||||
// and send out a new friend activity
|
// 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
|
// pull in a bit of content if there is any to pull in
|
||||||
proc_run('php','include/onepoll.php',$contact_id);
|
proc_run('php','include/onepoll.php',$contact_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh the structure in memory with the new data
|
// Refresh the structure in memory with the new data
|
||||||
@ -159,6 +162,11 @@ function connections_post(&$a) {
|
|||||||
$a->data['abook'] = $r[0];
|
$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);
|
connections_clone($a);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user