diff options
author | nobody <nobody@zotlabs.com> | 2021-02-17 01:05:30 -0800 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2021-02-17 01:05:30 -0800 |
commit | 383917eb0f219b999e1e46358317ab9ac8a9937d (patch) | |
tree | 8f8c75b09f50d994577bb9255c28afe9d8805e13 /include/items.php | |
parent | 7e3046b85cec84ffdd8f482ec2e519b165fe3d54 (diff) | |
download | volse-hubzilla-383917eb0f219b999e1e46358317ab9ac8a9937d.tar.gz volse-hubzilla-383917eb0f219b999e1e46358317ab9ac8a9937d.tar.bz2 volse-hubzilla-383917eb0f219b999e1e46358317ab9ac8a9937d.zip |
more zap export compatibility work
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php index bc3ce55ec..9a744787b 100644 --- a/include/items.php +++ b/include/items.php @@ -1167,9 +1167,9 @@ function encode_item($item,$mirror = false,$zap_compat = false) { $x['summary'] = $item['summary']; $x['body'] = $item['body']; $x['app'] = $item['app']; - $x['verb'] = $item['verb']; - $x['object_type'] = $item['obj_type']; - $x['target_type'] = $item['tgt_type']; + $x['verb'] = (($zap_compat) ? Activity::activity_mapper($item['verb']) : $item['verb']); + $x['object_type'] = (($zap_compat && $item['obj_type']) ? Activity::activity_object_mapper($item['obj_type']) : $item['obj_type']); + $x['target_type'] = (($zap_compat && $item['tgt_type']) ? Activity::activity_object_mapper($item['tgt_type']) : $item['tgt_type']); $x['permalink'] = $item['plink']; $x['location'] = $item['location']; $x['longlat'] = $item['coord']; @@ -1179,9 +1179,13 @@ function encode_item($item,$mirror = false,$zap_compat = false) { $x['author'] = encode_item_xchan($item['author']); if($item['obj']) - $x['object'] = json_decode($item['obj'],true); + $x['object'] = (($zap_compat) + ? Activity::encode_object(json_decode($item['obj'],true)) + : json_decode($item['obj'],true)) ; if($item['target']) - $x['target'] = json_decode($item['target'],true); + $x['target'] = (($zap_compat) + ? Activity::encode_object(json_decode($item['target'],true)) + : json_decode($item['target'],true)) ; if($item['attach']) $x['attach'] = json_decode($item['attach'],true); if($y = encode_item_flags($item)) |