aboutsummaryrefslogtreecommitdiffstats
path: root/include/apps.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/apps.php')
-rw-r--r--include/apps.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/apps.php b/include/apps.php
index 3d480d901..661fc2163 100644
--- a/include/apps.php
+++ b/include/apps.php
@@ -264,18 +264,37 @@ function app_install($uid,$app) {
else
$x = app_store($app);
- if($x['success'])
- return $x['app_id'];
+ if($x['success']) {
+ $r = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
+ dbesc($x['app_id']),
+ intval($uid)
+ );
+ if($r)
+ build_sync_packet($uid,array('app' => $r[0]));
+ return $x['app_id'];
+ }
return false;
}
function app_destroy($uid,$app) {
+
+
if($uid && $app['guid']) {
+
+ $x = q("select * from app where app_id = '%s' and app_channel = %d limit 1",
+ dbesc($app['guid']),
+ intval($uid)
+ );
+ $x[0]['app_deleted'] = 1;
+
+
$r = q("delete from app where app_id = '%s' and app_channel = %d",
dbesc($app['guid']),
intval($uid)
);
+
+ build_sync_packet($uid,array('app' => $x));
}
}