This commit is contained in:
redmatrix
2015-09-02 23:09:51 -07:00
parent fb2d2c5585
commit f3cb17ac3b
3 changed files with 91 additions and 2 deletions

View File

@@ -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));
}
}