aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-21 17:49:14 -0800
committerfriendica <info@friendica.com>2013-11-21 17:49:14 -0800
commitf2435ed4cdee6e20a92f2acfd60399cb92b2c1e3 (patch)
treea9ac036f157afb8cf708a175cbf869a0e405a0f4
parent8cdbd0e2a65cac16a5bad0fca1c3e2e5ec91e348 (diff)
downloadvolse-hubzilla-f2435ed4cdee6e20a92f2acfd60399cb92b2c1e3.tar.gz
volse-hubzilla-f2435ed4cdee6e20a92f2acfd60399cb92b2c1e3.tar.bz2
volse-hubzilla-f2435ed4cdee6e20a92f2acfd60399cb92b2c1e3.zip
follow and accept_follow hooks
-rw-r--r--include/follow.php4
-rw-r--r--mod/connections.php8
2 files changed, 12 insertions, 0 deletions
diff --git a/include/follow.php b/include/follow.php
index 5cf161304..845ce11da 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -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']);
}
+ $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($default_group) {
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;