pull in some posts when we first connect with a new channel (if allowed to) - if not allowed to, do it if that condition changes

This commit is contained in:
friendica
2013-11-17 19:22:24 -08:00
parent 772e3795bf
commit 13538cdd21
7 changed files with 49 additions and 26 deletions

View File

@@ -346,12 +346,12 @@ 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",
$new_connection = q("select abook_id, abook_flags 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))
if($new_connection && (! ($new_connection[0]['abook_flags'] & ABOOK_FLAG_PENDING)) && ($their_perms & PERMS_R_STREAM))
proc_run('php','include/onepoll.php',$new_connection[0]['abook_id']);
}