diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 23:09:51 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-02 23:09:51 -0700 |
commit | f3cb17ac3b007afd2dc5bf7cdad8a054b4d7fcd8 (patch) | |
tree | 92dd58c4e5a1881b01acb414ea1d218d77ef4721 /include/apps.php | |
parent | fb2d2c55851ce14fd0bd04b15be0518a86809b41 (diff) | |
download | volse-hubzilla-f3cb17ac3b007afd2dc5bf7cdad8a054b4d7fcd8.tar.gz volse-hubzilla-f3cb17ac3b007afd2dc5bf7cdad8a054b4d7fcd8.tar.bz2 volse-hubzilla-f3cb17ac3b007afd2dc5bf7cdad8a054b4d7fcd8.zip |
app sync
Diffstat (limited to 'include/apps.php')
-rw-r--r-- | include/apps.php | 23 |
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)); } } |