diff options
author | zotlabs <mike@macgirvin.com> | 2020-01-12 22:41:28 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2020-01-12 22:41:28 -0800 |
commit | d3cbbe029c1f19a77ac0c278f735d81b9dd3a3ec (patch) | |
tree | 327424bb0963a62a9a8bbfd2b8b588ced248080f /include/channel.php | |
parent | 88ebbd90d8925a74029a32f57ec581d2b3ba64ed (diff) | |
download | volse-hubzilla-d3cbbe029c1f19a77ac0c278f735d81b9dd3a3ec.tar.gz volse-hubzilla-d3cbbe029c1f19a77ac0c278f735d81b9dd3a3ec.tar.bz2 volse-hubzilla-d3cbbe029c1f19a77ac0c278f735d81b9dd3a3ec.zip |
rework activitystreams events - send invite/event activities instead of create/event. Also a first pass at creating a Zap export file from Hubzilla. Much more work is needed before this is functional.
Diffstat (limited to 'include/channel.php')
-rw-r--r-- | include/channel.php | 17 |
1 files changed, 14 insertions, 3 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']))) ]; } } |