From a1b66f56f0981a0853f180a458c401a80dda28ce Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 16 Sep 2014 03:33:48 -0700 Subject: use the more portable encoded_item format for exported items - but with added attributes so we can use it as a reasonably complete item backup. The encoded_item format gives us extended author and owner information in case we need to probe them to bring the entry back. It also contains taxonomy entries. Importing and/or recovering will best be accomplished in chunks. It could take some time and some memory to chew through this. --- include/identity.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'include/identity.php') diff --git a/include/identity.php b/include/identity.php index 1078ff082..2039738e0 100644 --- a/include/identity.php +++ b/include/identity.php @@ -489,18 +489,12 @@ function identity_basic_export($channel_id, $items = false) { intval($channel_id) ); if($r) { - for($x = 0; $x < count($r); $x ++) { - if($r[$x]['diaspora_meta']) - $r[$x]['diaspora_meta'] = crypto_unencapsulate(json_decode($r[$x]['diaspora_meta'],true),$key); - if($r[$x]['item_flags'] & ITEM_OBSCURED) { - $r[$x]['item_flags'] = $r[$x]['item_flags'] ^ ITEM_OBSCURED; - if($r[$x]['title']) - $r[$x]['title'] = crypto_unencapsulate(json_decode($r[$x]['title'],true),$key); - if($r[$x]['body']) - $r[$x]['body'] = crypto_unencapsulate(json_decode($r[$x]['body'],true),$key); - } - } - $ret['item'] = $r; + $ret['item'] = array(); + xchan_query($r); + $r = fetch_post_tags($r,true); + foreach($r as $rr) + $ret['item'][] = encode_item($rr,true); + } return $ret; -- cgit v1.2.3