aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-25 20:21:23 -0700
committerfriendica <info@friendica.com>2014-09-25 20:21:23 -0700
commitd8c03526ed24a4b26c589659d394848c81bacc53 (patch)
tree641a43b76b895773a920ffa89ffeb0f2e4241317 /include/items.php
parente75f1ccb2ee1d5219a385ae4ee05ab74ac4600fd (diff)
downloadvolse-hubzilla-d8c03526ed24a4b26c589659d394848c81bacc53.tar.gz
volse-hubzilla-d8c03526ed24a4b26c589659d394848c81bacc53.tar.bz2
volse-hubzilla-d8c03526ed24a4b26c589659d394848c81bacc53.zip
optionally include wall items (posts) in import/export
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index 315f9c44b..ac960258c 100755
--- a/include/items.php
+++ b/include/items.php
@@ -865,15 +865,37 @@ function get_item_elements($x) {
// We have to do that here because we need to cleanse the input and prevent bad stuff from getting in,
// and we need plaintext to do that.
+ $key = get_config('system','pubkey');
+
+
if(intval($arr['item_private'])) {
$arr['item_flags'] = $arr['item_flags'] | ITEM_OBSCURED;
- $key = get_config('system','pubkey');
if($arr['title'])
$arr['title'] = json_encode(crypto_encapsulate($arr['title'],$key));
if($arr['body'])
$arr['body'] = json_encode(crypto_encapsulate($arr['body'],$key));
}
+
+ if(array_key_exists('revision',$x)) {
+ // extended export encoding
+
+ $arr['revision'] = $x['revision'];
+ $arr['allow_cid'] = $x['allow_cid'];
+ $arr['allow_gid'] = $x['allow_gid'];
+ $arr['deny_cid'] = $x['deny_cid'];
+ $arr['deny_gid'] = $x['deny_gid'];
+ $arr['layout_mid'] = $x['layout_mid'];
+ $arr['postopts'] = $x['postopts'];
+ $arr['resource_id'] = $x['resource_id'];
+ $arr['resource_type'] = $x['resource_type'];
+ $arr['item_restrict'] = $x['item_restrict'];
+ $arr['item_flags'] = $x['item_flags'];
+ $arr['diaspora_meta'] = (($x['diaspora_meta']) ? json_encode(crypto_encapsulate($x['diaspora_meta'],$key)) : '');
+ $arr['attach'] = $x['attach'];
+
+ }
+
return $arr;
}