aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-01-15 10:30:02 +0100
committerMario <mario@mariovavti.com>2020-01-15 10:30:02 +0100
commit65bc3636854f0e3112ffc412dec3ddc16516dec9 (patch)
treea8b0af66015815d56342daf8301ab5ae095eda0a /include
parentd96f4340e80207a29a5c1c49cae8c25e3934d5ae (diff)
parent2a287e6def5ab54037222c963ab0875faf62fc1a (diff)
downloadvolse-hubzilla-65bc3636854f0e3112ffc412dec3ddc16516dec9.tar.gz
volse-hubzilla-65bc3636854f0e3112ffc412dec3ddc16516dec9.tar.bz2
volse-hubzilla-65bc3636854f0e3112ffc412dec3ddc16516dec9.zip
Merge branch 'dev' into 'dev'
event compatibility work See merge request hubzilla/core!1817
Diffstat (limited to 'include')
-rw-r--r--include/channel.php17
-rw-r--r--include/event.php12
2 files changed, 24 insertions, 5 deletions
diff --git a/include/channel.php b/include/channel.php
index 32bd596fc..e7d119b1e 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -796,7 +796,7 @@ function get_default_export_sections() {
* @return array
* See function for details
*/
-function identity_basic_export($channel_id, $sections = null) {
+function identity_basic_export($channel_id, $sections = null, $zap_compat = false) {
/*
* basic channel export
@@ -812,12 +812,16 @@ function identity_basic_export($channel_id, $sections = null) {
// with a non-standard platform and version.
$ret['compatibility'] = [
- 'project' => PLATFORM_NAME,
+ 'project' => (($zap_compat) ? 'zap' : PLATFORM_NAME),
'version' => STD_VERSION,
'database' => DB_UPDATE_VERSION,
'server_role' => System::get_server_role()
];
+ if ($zap_compat) {
+ $ret['compatibility']['codebase'] = 'zap';
+ }
+
/*
* Process channel information regardless of it is one of the sections desired
* because we need the channel relocation information in all export files/streams.
@@ -834,6 +838,13 @@ function identity_basic_export($channel_id, $sections = null) {
unset($ret['channel']['channel_password']);
unset($ret['channel']['channel_salt']);
}
+ if ($zap_compat) {
+ $channel['channel_guid_sig'] = 'sha256.' . $channel['channel_guid_sig'];
+ $channel['channel_hash'] = $channel['channel_portable_id'];
+ unset($channel['channel_portable_id']);
+ }
+
+
}
if(in_array('channel',$sections) || in_array('profile',$sections)) {
@@ -853,7 +864,7 @@ function identity_basic_export($channel_id, $sections = null) {
$ret['photo'] = [
'type' => $r[0]['mimetype'],
'data' => (($r[0]['os_storage'])
- ? base64url_encode(file_get_contents($r[0]['content'])) : base64url_encode($r[0]['content']))
+ ? base64url_encode(file_get_contents($r[0]['content'])) : base64url_encode(dbunescbin($r[0]['content'])))
];
}
}
diff --git a/include/event.php b/include/event.php
index 9d76aabd6..59057e7d5 100644
--- a/include/event.php
+++ b/include/event.php
@@ -250,7 +250,7 @@ function format_ical_sourcetext($s) {
}
-function format_event_bbcode($ev) {
+function format_event_bbcode($ev, $utc = false) {
$o = '';
@@ -258,6 +258,14 @@ function format_event_bbcode($ev) {
$o .= '[event]' . $ev['event_vdata'] . '[/event]';
}
+ if ($utc && $ev['event-timezone'] !== 'UTC') {
+ $ev['dtstart'] = datetime_convert($ev['timezone'],'UTC',$ev['dtstart'],ATOM_TIME);
+ if ($ev['dtend'] && ! $ev['nofinish']) {
+ $ev['dtend'] = datetime_convert($ev['timezone'],'UTC',$ev['dtend'],ATOM_TIME);
+ }
+ $ev['timezone'] = 'UTC';
+ }
+
if($ev['summary'])
$o .= '[event-summary]' . $ev['summary'] . '[/event-summary]';
@@ -1194,7 +1202,7 @@ function event_store_item($arr, $event) {
if(! $arr['mid']) {
$arr['uuid'] = $event['event_hash'];
- $arr['mid'] = z_root() . '/event/' . $event['event_hash'];
+ $arr['mid'] = z_root() . '/activity/' . $event['event_hash'];
}
$item_arr['aid'] = $z[0]['channel_account_id'];