aboutsummaryrefslogtreecommitdiffstats
path: root/include/import.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2021-10-06 09:36:14 +0200
committerMario Vavti <mario@mariovavti.com>2021-10-06 09:36:14 +0200
commitc33660a015ff4a2ed387caa4064fc8c4d8655419 (patch)
tree42a3bf620a54713ffc584efeb7d0006e94189b13 /include/import.php
parent16281e0e7fbc4ff691f6190ddc80632b411d2801 (diff)
downloadvolse-hubzilla-c33660a015ff4a2ed387caa4064fc8c4d8655419.tar.gz
volse-hubzilla-c33660a015ff4a2ed387caa4064fc8c4d8655419.tar.bz2
volse-hubzilla-c33660a015ff4a2ed387caa4064fc8c4d8655419.zip
move sync logic for apps to mod appman. this way we can re-use the functions without creating sync loops.
Diffstat (limited to 'include/import.php')
-rw-r--r--include/import.php27
1 files changed, 2 insertions, 25 deletions
diff --git a/include/import.php b/include/import.php
index 6186fd6ed..c6d89b5f3 100644
--- a/include/import.php
+++ b/include/import.php
@@ -591,7 +591,6 @@ function import_sysapps($channel, $apps) {
function sync_sysapps($channel, $apps) {
$sysapps = Apps::get_system_apps(false, true);
-
if ($channel && $apps) {
$columns = db_columns('app');
@@ -608,30 +607,8 @@ function sync_sysapps($channel, $apps) {
foreach ($sysapps as $sysapp) {
if ($app['app_id'] === hash('whirlpool', $sysapp['name'])) {
- if (array_key_exists('app_deleted',$app) && $app['app_deleted'] && $app['app_id']) {
- if(Apps::can_delete($channel['channel_id'], ['guid' => $app['app_id']])) {
- $local_app = q("select id from app where app_id = '%s' and app_channel = %d limit 1",
- dbesc($app['app_id']),
- intval($channel['channel_id'])
- );
- if ($local_app) {
- q("delete from term where otype = %d and oid = %d",
- intval(TERM_OBJ_APP),
- intval($local_app[0]['id'])
- );
-
- q("delete from app where app_id = '%s' and app_channel = %d",
- dbesc($app['app_id']),
- intval($channel['channel_id'])
- );
- }
- }
- else {
- q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",
- dbesc($app['app_id']),
- intval($channel['channel_id'])
- );
- }
+ if (array_key_exists('app_deleted',$app) && $app['app_deleted'] == 1 && $app['app_id']) {
+ Apps::app_destroy($channel['channel_id'], ['guid' => $app['app_id']]);
}
else {
// install this app on this server