From 328685d2fbe505fd5b1bf9892a0cce993210ac52 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 9 Apr 2020 09:38:36 +0000 Subject: move from build_sync_packet() to Libsync::build_sync_packet() --- include/attach.php | 6 ++++-- include/channel.php | 4 ++-- include/event.php | 3 ++- include/group.php | 9 +++++---- include/items.php | 9 +++++---- include/menu.php | 4 +++- 6 files changed, 21 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/attach.php b/include/attach.php index 952270949..d986f4af1 100644 --- a/include/attach.php +++ b/include/attach.php @@ -11,6 +11,8 @@ * @todo Also an 'append' option to the storage function might be a useful addition. */ +use Zotlabs\Lib\Libsync; + require_once('include/permissions.php'); require_once('include/security.php'); require_once('include/group.php'); @@ -1018,7 +1020,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { $sync = attach_export_data($channel,$hash); if($sync) - build_sync_packet($channel['channel_id'],array('file' => array($sync))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync))); } if($notify) { @@ -1403,7 +1405,7 @@ function attach_change_permissions($channel_id, $resource, $allow_cid, $allow_gi $data = attach_export_data($channel,$resource); if($data) - build_sync_packet($channel['channel_id'],array('file' => array($data))); + Libsync::build_sync_packet($channel['channel_id'],array('file' => array($data))); } } diff --git a/include/channel.php b/include/channel.php index 25eb93cac..be58f154a 100644 --- a/include/channel.php +++ b/include/channel.php @@ -673,7 +673,7 @@ function change_channel_keys($channel) { } } - build_sync_packet($channel['channel_id'], [ 'keychange' => $stored ]); + Libsync::build_sync_packet($channel['channel_id'], [ 'keychange' => $stored ]); $a = q("select * from abook where abook_xchan = '%s' and abook_self = 1", dbesc($stored['old_hash']) @@ -2241,7 +2241,7 @@ function profiles_build_sync($channel_id,$send = true) { ); if($r) { if($send) { - build_sync_packet($channel_id,array('profile' => $r)); + Libsync::build_sync_packet($channel_id,array('profile' => $r)); } else { return $r; diff --git a/include/event.php b/include/event.php index 69ca64e0f..c9cbb7c94 100644 --- a/include/event.php +++ b/include/event.php @@ -8,6 +8,7 @@ use Sabre\VObject; use Zotlabs\Lib\Activity; +use Zotlabs\Lib\Libsync; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; @@ -663,7 +664,7 @@ function event_addtocal($item_id, $uid) { intval($channel['channel_id']) ); if($z) { - build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z)); + Libsync::build_sync_packet($channel['channel_id'],array('event_item' => array(encode_item($sync_item[0],true)),'event' => $z)); } return true; } diff --git a/include/group.php b/include/group.php index 6011af08f..efda389d6 100644 --- a/include/group.php +++ b/include/group.php @@ -1,5 +1,6 @@ [$sync_data]]); + Libsync::build_sync_packet($item['uid'], ['event' => [$sync_data]]); } } @@ -3882,7 +3883,7 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL) { $channel = channelx_by_n($item['uid']); $sync_data = attach_export_data($channel, $item['resource_id'], true); if($sync_data) - build_sync_packet($item['uid'], ['file' => [$sync_data]]); + Libsync::build_sync_packet($item['uid'], ['file' => [$sync_data]]); } // immediately remove any undesired profile likes. @@ -4726,7 +4727,7 @@ function sync_an_item($channel_id,$item_id) { if($r) { xchan_query($r); $sync_item = fetch_post_tags($r); - build_sync_packet($channel_id, array('item' => array(encode_item($sync_item[0],true)))); + Libsync::build_sync_packet($channel_id, array('item' => array(encode_item($sync_item[0],true)))); } } @@ -4928,7 +4929,7 @@ function item_create_edit_activity($post) { if($r) { xchan_query($r); $sync_item = fetch_post_tags($r); - build_sync_packet($new_item['uid'],array('item' => array(encode_item($sync_item[0],true)))); + Libsync::build_sync_packet($new_item['uid'],array('item' => array(encode_item($sync_item[0],true)))); } } diff --git a/include/menu.php b/include/menu.php index 1a2059451..88863f57b 100644 --- a/include/menu.php +++ b/include/menu.php @@ -1,5 +1,7 @@ array(menu_element($c,$m)))); + Libsync::build_sync_packet($uid,array('menu' => array(menu_element($c,$m)))); } } } -- cgit v1.2.3