aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-17 16:50:32 -0800
committerfriendica <info@friendica.com>2013-11-17 16:50:32 -0800
commit06e0272db873ad0b7dbc96596e92b8c635f940a2 (patch)
treecc9c69c446e13de010baa4fe2dcd2c401aef4f94 /include/zot.php
parent28b0eb9c330261ea6a8cd36248c194b6b153f5e6 (diff)
downloadvolse-hubzilla-06e0272db873ad0b7dbc96596e92b8c635f940a2.tar.gz
volse-hubzilla-06e0272db873ad0b7dbc96596e92b8c635f940a2.tar.bz2
volse-hubzilla-06e0272db873ad0b7dbc96596e92b8c635f940a2.zip
populate some posts when somebody is granted "read stream" permission
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']);
+
}
}
}