aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/zot.php b/include/zot.php
index 09a3c28fa..71f720a6d 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -306,6 +306,11 @@ function zot_refresh($them,$channel = null) {
);
if(! $y)
logger('abook update failed');
+ else {
+ // if we were just granted read stream permission and didn't have it before, try to pull in some posts
+ if((! ($r[0]['abook_their_perms'] & PERMS_R_STREAM)) && ($their_perms & PERMS_R_STREAM))
+ proc_run('php','include/onepoll.php',$r[0]['abook_id']);
+ }
}
else {
$default_perms = 0;
@@ -330,7 +335,6 @@ function zot_refresh($them,$channel = null) {
);
if($y) {
-
logger("New introduction received for {$channel['channel_name']}");
if($default_perms) {
// send back a permissions update for auto-friend/auto-permissions
@@ -342,6 +346,14 @@ function zot_refresh($them,$channel = null) {
if($z)
proc_run('php','include/notifier.php','permission_update',$z[0]['abook_id']);
}
+ $new_connection = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s' order by abook_created desc limit 1",
+ intval($channel['channel_id']),
+ dbesc($x['hash'])
+ );
+
+ if($new_connection && ($their_perms & PERMS_R_STREAM))
+ proc_run('php','include/onepoll.php',$new_connection[0]['abook_id']);
+
}
}
}