From 60e73c01ac1f48ff5d503d6a6c6c5dcf10b9de9f Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 17 Mar 2022 19:26:10 -0700 Subject: [PATCH] task sync --- Code/Lib/Libsync.php | 2 +- Code/Module/Tasks.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Code/Lib/Libsync.php b/Code/Lib/Libsync.php index 5277bc62a..d112f55b6 100644 --- a/Code/Lib/Libsync.php +++ b/Code/Lib/Libsync.php @@ -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) { diff --git a/Code/Module/Tasks.php b/Code/Module/Tasks.php index bd95c3cb6..3650f039c 100644 --- a/Code/Module/Tasks.php +++ b/Code/Module/Tasks.php @@ -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); } }