From 43e55eb9a6cb66ad040064fca8b8296bcd298a03 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 16 Apr 2018 21:40:43 -0700 Subject: Active channels information is a bit imprecise. Provide a higher accuracy method. This will require a transition period --- include/zot.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 2ad43f0e5..c2b622277 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3208,6 +3208,9 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { $channel = $r[0]; + // don't provide these in the export + + unset($channel['channel_active']); unset($channel['channel_password']); unset($channel['channel_salt']); @@ -3474,6 +3477,14 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { continue; } + // if the clone is active, so are we + + if(substr($channel['channel_active'],0,10) !== substr(datetime_convert(),0,10)) { + q("UPDATE channel set channel_active = '%s' where channel_id = %d", + dbesc(datetime_convert()), + intval($channel['channel_id']) + ); + } if(array_key_exists('config',$arr) && is_array($arr['config']) && count($arr['config'])) { foreach($arr['config'] as $cat => $k) { -- cgit v1.2.3