diff options
author | redmatrix <git@macgirvin.com> | 2016-06-21 18:18:06 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-06-21 18:24:36 -0700 |
commit | b593c3a9b90bc35e7bfa320acffb63b9b0f3de93 (patch) | |
tree | 3e6d54e3e23b17709c4f5d1c94abccd106cb95ed /include/zot.php | |
parent | 63423c8ee1f750d855c75ed67205076d21eda4f1 (diff) | |
download | volse-hubzilla-b593c3a9b90bc35e7bfa320acffb63b9b0f3de93.tar.gz volse-hubzilla-b593c3a9b90bc35e7bfa320acffb63b9b0f3de93.tar.bz2 volse-hubzilla-b593c3a9b90bc35e7bfa320acffb63b9b0f3de93.zip |
1. provide automatic relocation of important links in items that are imported or synced to clones
2. provide framework for custom curl request bodies using custom/non-standard request methods. This was a real nightmare because curl doesn't actually let you specify a string to send as the request body (except when doing POST). You have to treat it as a file upload using a custom file handler function which provides the actual content in chunks as if it were buffered I/O.
3. item_store and item_store_update now return the item that was stored
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/zot.php b/include/zot.php index 043139e2f..2530e55bb 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3031,7 +3031,8 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { $info = (($packet) ? $packet : array()); $info['type'] = 'channel_sync'; - $info['encoding'] = 'red'; // note: not zot, this packet is very red specific + $info['encoding'] = 'red'; // note: not zot, this packet is very platform specific + $info['relocate'] = ['channel_address' => $channel['channel_address'], 'url' => z_root() ]; if(array_key_exists($uid,App::$config) && array_key_exists('transient',App::$config[$uid])) { $settings = App::$config[$uid]['transient']; @@ -3169,10 +3170,13 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { sync_events($channel,$arr['event']); if(array_key_exists('event_item',$arr) && $arr['event_item']) - sync_items($channel,$arr['event_item']); + sync_items($channel,$arr['event_item'],((array_key_exists('relocate',$arr)) ? $arr['relocate'] : null)); if(array_key_exists('item',$arr) && $arr['item']) - sync_items($channel,$arr['item']); + sync_items($channel,$arr['item'],((array_key_exists('relocate',$arr)) ? $arr['relocate'] : null)); + + // deprecated, maintaining for a few months for upward compatibility + // this should sync webpages, but the logic is a bit subtle if(array_key_exists('item_id',$arr) && $arr['item_id']) sync_items($channel,$arr['item_id']); @@ -3529,13 +3533,6 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } } - - if(array_key_exists('item',$arr) && $arr['item']) - sync_items($channel,$arr['item']); - - if(array_key_exists('item_id',$arr) && $arr['item_id']) - sync_items($channel,$arr['item_id']); - $addon = array('channel' => $channel,'data' => $arr); call_hooks('process_channel_sync_delivery',$addon); |