Merge branch 'dev' of ../unfediverse.com into dev

This commit is contained in:
nobody 2022-03-17 19:31:37 -07:00
commit f4a934b462
3 changed files with 11 additions and 5 deletions

View file

@ -33,7 +33,7 @@ class Libsync
public static function build_sync_packet($uid = 0, $packet = null, $groups_changed = false)
{
//logger('build_sync_packet');
// logger('build_sync_packet');
$keychange = (($packet && array_key_exists('keychange', $packet)) ? true : false);
if ($keychange) {

View file

@ -4,6 +4,7 @@ namespace Code\Module;
use App;
use Code\Web\Controller;
use Code\Lib\Libsync;
use Code\Lib\Apps;
use Code\Widget\Tasklist;
@ -70,6 +71,7 @@ class Tasks extends Controller
}
$x = event_store_event($event);
if ($x) {
Libsync::build_sync_packet($channel['channel_id'], ['event' => [$x]]);
$ret['success'] = true;
}
}
@ -93,10 +95,13 @@ class Tasks extends Controller
$event['summary'] = escape_tags($_REQUEST['summary']);
$x = event_store_event($event);
if ($x) {
Libsync::build_sync_packet($channel['channel_id'], ['event' => [$x]]);
$x['success'] = true;
} else {
}
else {
$x = ['success' => false];
}
json_return_and_die($x);
}
}

View file

@ -764,6 +764,7 @@ function import_sysapps($channel, $apps)
$sysapps = Apps::get_system_apps(false);
foreach ($apps as $app) {
if (array_key_exists('app_system', $app) && (! intval($app['app_system']))) {
continue;
}
@ -775,7 +776,7 @@ function import_sysapps($channel, $apps)
$term = ((array_key_exists('term', $app) && is_array($app['term'])) ? $app['term'] : null);
foreach ($sysapps as $sysapp) {
if ($app['app_id'] === hash('whirlpool', $sysapp['app_name'])) {
if ($app['app_id'] === hash('whirlpool', $sysapp['name'])) {
// install this app on this server
$newapp = $sysapp;
$newapp['uid'] = $channel['channel_id'];
@ -811,7 +812,7 @@ function sync_sysapps($channel, $apps)
{
$sysapps = Apps::get_system_apps(false);
if ($channel && $apps) {
$columns = db_columns('app');
@ -824,7 +825,7 @@ function sync_sysapps($channel, $apps)
}
foreach ($sysapps as $sysapp) {
if ($app['app_id'] === hash('whirlpool', $sysapp['app_name'])) {
if ($app['app_id'] === hash('whirlpool', $sysapp['name'])) {
if (array_key_exists('app_deleted', $app) && $app['app_deleted'] && $app['app_id']) {
q(
"update app set app_deleted = 1 where app_id = '%s' and app_channel = %d",