From b9466941e77eea806539ea56b6b625d354968f4c Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 26 Jun 2013 17:31:02 -0700 Subject: more work on channel sync --- include/settings.php | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'include/settings.php') diff --git a/include/settings.php b/include/settings.php index 94cb6f65b..e53cfedfa 100644 --- a/include/settings.php +++ b/include/settings.php @@ -1,9 +1,17 @@ $r[0]['xchan_guid'],'guid_sig' => $r[0]['xchan_guid_sig']); + $info = (($packet) ? $packet : array()); if(array_key_exists($uid,$a->config) && array_key_exists('transient',$a->config[$uid])) { @@ -41,10 +58,14 @@ function build_sync_packet($packet = null) { foreach($channel as $k => $v) { if(strpos('channel_',$k) !== 0) continue; - if($k === 'channel_id') - continue; - if($k === 'channel_account_id') + + // don't pass these elements, they should not be synchronised + + $disallowed = array('channel_id','channel_account_id','channel_primary','channel_prvkey'); + + if(in_array($k,$disallowed)) continue; + $info['channel'][$k] = $v; } } @@ -55,7 +76,7 @@ function build_sync_packet($packet = null) { foreach($synchubs as $hub) { $hash = random_string(); - $n = zot_build_packet($channel,'channel_sync'); + $n = zot_build_packet($channel,'channel_sync',$env_recips,$hub['hubloc_sitekey'],null,$hash); q("insert into outq ( outq_hash, outq_account, outq_channel, outq_posturl, outq_async, outq_created, outq_updated, outq_notify, outq_msg ) values ( '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s' )", dbesc($hash), intval($channel['channel_account']), -- cgit v1.2.3