app store fixes

This commit is contained in:
zotlabs 2018-07-05 21:46:34 -07:00
parent f6e8ce5516
commit c80e009cf3

View File

@ -156,17 +156,20 @@ class Apps {
* is discovered, or if the version of a system app changes. * is discovered, or if the version of a system app changes.
*/ */
static public function check_install_personal_app($app) { static public function check_install_personal_app($app) {
$installed = false;
foreach(self::$installed_apps as $iapp) { foreach(self::$installed_apps as $iapp) {
$install = false;
if($iapp['app_id'] == hash('whirlpool',$app['name'])) { if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$installed = true;
if(($iapp['app_version'] != $app['version']) if(($iapp['app_version'] != $app['version'])
|| ($app['plugin'] && (! $iapp['app_plugin']))) { || ($app['plugin'] && (! $iapp['app_plugin']))) {
return intval($iapp['app_id']); return intval($iapp['app_id']);
} }
} }
} }
if(in_array($app['name'],self::$base_apps)) { if(! $installed && in_array($app['name'],self::$base_apps)) {
return true; return true;
} }
return false; return false;
@ -531,21 +534,13 @@ class Apps {
intval(TERM_OBJ_APP), intval(TERM_OBJ_APP),
intval($x[0]['id']) intval($x[0]['id'])
); );
if($x[0]['app_system']) { $r = q("delete from app where app_id = '%s' and app_channel = %d",
$r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d", dbesc($app['guid']),
dbesc($app['guid']), intval($uid)
intval($uid) );
);
}
else {
$r = q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
// we don't sync system apps - they may be completely different on the other system // we don't sync system apps - they may be completely different on the other system
build_sync_packet($uid,array('app' => $x)); build_sync_packet($uid,array('app' => $x));
}
} }
else { else {
self::app_undestroy($uid,$app); self::app_undestroy($uid,$app);
@ -945,7 +940,7 @@ class Apps {
// if updating an embed app, don't mess with any existing categories. // if updating an embed app, don't mess with any existing categories.
if(array_key_exists('embed',$arr) && intval($arr['embed'])) if(array_key_exists('embed',$arr) && intval($arr['embed']) && (intval($darray['app_channel'])))
return $ret; return $ret;
if($x) { if($x) {