aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2021-02-17 16:36:27 -0800
committernobody <nobody@zotlabs.com>2021-02-17 16:36:27 -0800
commit8a65fc8a43116fcdce12bcbccd452b82a70d8da1 (patch)
treeaf411f37870fa892197a4b8dd1b9248a25c3232f
parent0b95e061a3f15a21913e8d3c505dfe5d3fccb287 (diff)
downloadvolse-hubzilla-8a65fc8a43116fcdce12bcbccd452b82a70d8da1.tar.gz
volse-hubzilla-8a65fc8a43116fcdce12bcbccd452b82a70d8da1.tar.bz2
volse-hubzilla-8a65fc8a43116fcdce12bcbccd452b82a70d8da1.zip
more work on hz->zap migration stuff
-rw-r--r--include/api_zot.php7
-rw-r--r--include/attach.php4
-rw-r--r--include/channel.php8
3 files changed, 13 insertions, 6 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index 0ec9202dc..9beaaa19c 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -87,7 +87,7 @@
return false;
}
$sections = (($_REQUEST['sections']) ? explode(',',$_REQUEST['sections']) : '');
- $codebase = ((isset($_REQUEST['codebase']) && $_REQUEST['codebase'] === 'zap') ? true : false);
+ $codebase = ((isset($_REQUEST['zap_compat']) && $_REQUEST['zap_compat']) ? true : false);
if($_REQUEST['posts']) {
$sections = get_default_export_sections();
$sections[] = 'items';
@@ -112,7 +112,7 @@
$start = datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['since']);
}
$finish = datetime_convert(date_default_timezone_get(),'UTC', (($_REQUEST['until']) ? $_REQUEST['until'] : 'now'));
- $codebase = ((isset($_REQUEST['codebase']) && $_REQUEST['codebase'] === 'zap') ? true : false);
+ $codebase = ((isset($_REQUEST['zap_compat']) && $_REQUEST['zap_compat']) ? true : false);
json_return_and_die(channel_export_items_page(api_user(),$start,$finish,$page,$records,$codebase));
}
@@ -291,10 +291,11 @@
return false;
if(! $_REQUEST['file_id'])
return false;
+ $codebase = ((isset($_REQUEST['zap_compat']) && $_REQUEST['zap_compat']) ? true : false);
$channel = channelx_by_n(api_user());
- $ret = attach_export_data($channel,$_REQUEST['file_id']);
+ $ret = attach_export_data($channel,$_REQUEST['file_id'],false,$codebase);
if($ret) {
json_return_and_die($ret);
diff --git a/include/attach.php b/include/attach.php
index 9ba6be109..db7046ef0 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -2339,7 +2339,7 @@ function filepath_macro($s) {
}
-function attach_export_data($channel, $resource_id, $deleted = false) {
+function attach_export_data($channel, $resource_id, $deleted = false, $zap_compat = false) {
$ret = array();
@@ -2429,7 +2429,7 @@ function attach_export_data($channel, $resource_id, $deleted = false) {
xchan_query($items);
$items = fetch_post_tags($items,true);
foreach($items as $rr)
- $ret['item'][] = encode_item($rr,true);
+ $ret['item'][] = encode_item($rr,true,$zap_compat);
}
}
}
diff --git a/include/channel.php b/include/channel.php
index 800871ab6..cc5761162 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1088,11 +1088,17 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
}
if(in_array('events',$sections)) {
+
+ // @fixme - Not totally certain how to handle $zot_compat for the event timezone which exists
+ // in Hubzilla but is stored with the item and not the event. In Zap, stored information is
+ // always UTC and localised on access as per standard conventions for working with global time data.
+
$r = q("select * from event where uid = %d",
intval($channel_id)
);
- if($r)
+ if ($r) {
$ret['event'] = $r;
+ }
$r = q("select * from item where resource_type = 'event' and uid = %d",
intval($channel_id)