From 6da7fe7d27b30f691c07e5fb767afc904c3063c0 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 4 Oct 2021 09:24:13 +0000 Subject: provide system app sync --- Zotlabs/Lib/Apps.php | 9 +++++++-- Zotlabs/Lib/Libsync.php | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Lib') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 3c09adaa5..89be58311 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -635,13 +635,18 @@ class Apps { intval($uid) ); if($r) { - if(($app['uid']) && (! $r[0]['app_system'])) { + if($app['uid']) { if($app['categories'] && (! $app['term'])) { $r[0]['term'] = q("select * from term where otype = %d and oid = %d", intval(TERM_OBJ_APP), intval($r[0]['id']) ); - Libsync::build_sync_packet($uid,array('app' => $r[0])); + } + if (intval($r[0]['app_system'])) { + Libsync::build_sync_packet($uid, ['sysapp' => $r[0]]); + } + else { + Libsync::build_sync_packet($uid, ['app' => $r[0]]); } } } diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index 2b47fcf1a..e08f14447 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -246,6 +246,10 @@ class Libsync { if (array_key_exists('app', $arr) && $arr['app']) sync_apps($channel, $arr['app']); + if (array_key_exists('sysapp',$arr) && $arr['sysapp']) { + sync_sysapps($channel,$arr['sysapp']); + } + if (array_key_exists('addressbook', $arr) && $arr['addressbook']) sync_addressbook($channel, $arr['addressbook']); -- cgit v1.2.3