mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-21 02:35:19 +00:00
Merge branch 'dev' of ../unfediverse.com into dev
This commit is contained in:
commit
f4a934b462
3 changed files with 11 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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'];
|
||||
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue