refresh issue

This commit is contained in:
redmatrix 2015-12-27 21:08:28 -08:00
parent 5a229234e7
commit cf5df259e5
3 changed files with 10 additions and 3 deletions

View File

@ -122,6 +122,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
else else
$permissions = $j['permissions']; $permissions = $j['permissions'];
foreach($permissions as $k => $v) { foreach($permissions as $k => $v) {
if($v) { if($v) {
$their_perms = $their_perms | intval($global_perms[$k][1]); $their_perms = $their_perms | intval($global_perms[$k][1]);
@ -167,6 +168,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
} }
} }
if(! $xchan_hash) { if(! $xchan_hash) {
$result['message'] = t('Channel discovery failed.'); $result['message'] = t('Channel discovery failed.');
logger('follow: ' . $result['message']); logger('follow: ' . $result['message']);
@ -202,6 +204,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
$default_group = $r[0]['channel_default_group']; $default_group = $r[0]['channel_default_group'];
} }
if($is_http) { if($is_http) {
@ -226,6 +229,8 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
dbesc($xchan_hash), dbesc($xchan_hash),
intval($uid) intval($uid)
); );
if($r) { if($r) {
$abook_instance = $r[0]['abook_instance']; $abook_instance = $r[0]['abook_instance'];
@ -242,7 +247,6 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
); );
} }
else { else {
$closeness = get_pconfig($uid,'system','new_abook_closeness'); $closeness = get_pconfig($uid,'system','new_abook_closeness');
if($closeness === false) if($closeness === false)
$closeness = 80; $closeness = 80;
@ -270,6 +274,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
dbesc($xchan_hash), dbesc($xchan_hash),
intval($uid) intval($uid)
); );
if($r) { if($r) {
$result['abook'] = $r[0]; $result['abook'] = $r[0];
proc_run('php', 'include/notifier.php', 'permission_create', $result['abook']['abook_id']); proc_run('php', 'include/notifier.php', 'permission_create', $result['abook']['abook_id']);

View File

@ -188,6 +188,8 @@ function notifier_run($argv, $argc){
$recipients[] = $r[0]['abook_xchan']; $recipients[] = $r[0]['abook_xchan'];
$private = false; $private = false;
$packet_type = 'refresh'; $packet_type = 'refresh';
$packet_recips = array(array('guid' => $r[0]['xchan_guid'],'guid_sig' => $r[0]['xchan_guid_sig'],'hash' => $r[0]['xchan_hash']));
} }
} }
} }
@ -547,7 +549,7 @@ function notifier_run($argv, $argc){
$packet = null; $packet = null;
if($packet_type === 'refresh' || $packet_type === 'purge') { if($packet_type === 'refresh' || $packet_type === 'purge') {
$packet = zot_build_packet($channel,$packet_type); $packet = zot_build_packet($channel,$packet_type,(($packet_recips) ? $packet_recips : null));
} }
elseif($packet_type === 'request') { elseif($packet_type === 'request') {
$packet = zot_build_packet($channel,$packet_type,$env_recips,$hub['hubloc_sitekey'],$hash, $packet = zot_build_packet($channel,$packet_type,$env_recips,$hub['hubloc_sitekey'],$hash,

View File

@ -1 +1 @@
2015-12-25.1257 2015-12-27.1259