aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2021-02-17 01:05:30 -0800
committernobody <nobody@zotlabs.com>2021-02-17 01:05:30 -0800
commit383917eb0f219b999e1e46358317ab9ac8a9937d (patch)
tree8f8c75b09f50d994577bb9255c28afe9d8805e13
parent7e3046b85cec84ffdd8f482ec2e519b165fe3d54 (diff)
downloadvolse-hubzilla-383917eb0f219b999e1e46358317ab9ac8a9937d.tar.gz
volse-hubzilla-383917eb0f219b999e1e46358317ab9ac8a9937d.tar.bz2
volse-hubzilla-383917eb0f219b999e1e46358317ab9ac8a9937d.zip
more zap export compatibility work
-rw-r--r--include/channel.php12
-rw-r--r--include/items.php14
2 files changed, 15 insertions, 11 deletions
diff --git a/include/channel.php b/include/channel.php
index ba4f6c6d9..800871ab6 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1102,7 +1102,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach($r as $rr)
- $ret['event_item'][] = encode_item($rr,true);
+ $ret['event_item'][] = encode_item($rr,true, $zap_compat);
}
}
@@ -1125,7 +1125,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach($r as $rr)
- $ret['webpages'][] = encode_item($rr,true);
+ $ret['webpages'][] = encode_item($rr,true, $zap_compat);
}
}
@@ -1162,7 +1162,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach($r as $rv) {
- $ret['wiki'][] = encode_item($rv,true);
+ $ret['wiki'][] = encode_item($rv,true, $zap_compat);
}
}
}
@@ -1187,7 +1187,7 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach($r as $rr)
- $ret['item'][] = encode_item($rr,true);
+ $ret['item'][] = encode_item($rr,true, $zap_compat);
}
}
@@ -1283,7 +1283,7 @@ function channel_export_items_date($channel_id, $start, $finish, $zap_compat = f
xchan_query($r);
$r = fetch_post_tags($r, true);
foreach($r as $rr)
- $ret['item'][] = encode_item($rr, true);
+ $ret['item'][] = encode_item($rr, true, $zap_compat);
}
return $ret;
@@ -1347,7 +1347,7 @@ function channel_export_items_page($channel_id, $start, $finish, $page = 0, $lim
xchan_query($r);
$r = fetch_post_tags($r, true);
foreach($r as $rr)
- $ret['item'][] = encode_item($rr, true);
+ $ret['item'][] = encode_item($rr, true, $zap_compat);
}
return $ret;
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))