diff options
author | Mario <mario@mariovavti.com> | 2019-05-29 09:06:52 +0200 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-05-29 09:06:52 +0200 |
commit | 767a235611012200c6767ca602d736e7ab3b8b40 (patch) | |
tree | 02e161ec42c61fed13ac5020a0a0f0b3dda1f887 /Zotlabs | |
parent | ca8d252ad75306e6d3cd066d5c593e94de1dfbdd (diff) | |
parent | 620fc06b6cd068d6819e1613c4ef0ad10f3ba2a6 (diff) | |
download | volse-hubzilla-767a235611012200c6767ca602d736e7ab3b8b40.tar.gz volse-hubzilla-767a235611012200c6767ca602d736e7ab3b8b40.tar.bz2 volse-hubzilla-767a235611012200c6767ca602d736e7ab3b8b40.zip |
Merge branch 'dev' into 'dev'
support 'expires' over Zot6
See merge request hubzilla/core!1661
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 44 | ||||
-rw-r--r-- | Zotlabs/Module/Apschema.php | 1 |
2 files changed, 31 insertions, 14 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 0843e0a7b..4a1171c5d 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -294,8 +294,12 @@ class Activity { $ret['published'] = datetime_convert('UTC','UTC',$i['created'],ATOM_TIME); if($i['created'] !== $i['edited']) $ret['updated'] = datetime_convert('UTC','UTC',$i['edited'],ATOM_TIME); + if ($i['expires'] <= NULL_DATE) { + $ret['expires'] = datetime_convert('UTC','UTC',$i['expires'],ATOM_TIME); + } + if($i['app']) { - $ret['instrument'] = [ 'type' => 'Service', 'name' => $i['app'] ]; + $ret['generator'] = [ 'type' => 'Application', 'name' => $i['app'] ]; } if($i['location'] || $i['coord']) { $ret['location'] = [ 'type' => 'Place' ]; @@ -502,7 +506,7 @@ class Activity { if($i['created'] !== $i['edited']) $ret['updated'] = datetime_convert('UTC','UTC',$i['edited'],ATOM_TIME); if($i['app']) { - $ret['instrument'] = [ 'type' => 'Service', 'name' => $i['app'] ]; + $ret['generator'] = [ 'type' => 'Application', 'name' => $i['app'] ]; } if($i['location'] || $i['coord']) { $ret['location'] = [ 'type' => 'Place' ]; @@ -1309,6 +1313,12 @@ class Activity { elseif($act->obj['updated']) { $s['edited'] = datetime_convert('UTC','UTC',$act->obj['updated']); } + if ($act->data['expires']) { + $s['expires'] = datetime_convert('UTC','UTC',$act->data['expires']); + } + elseif ($act->obj['expires']) { + $s['expires'] = datetime_convert('UTC','UTC',$act->obj['expires']); + } if(! $s['created']) $s['created'] = datetime_convert(); @@ -1327,13 +1337,13 @@ class Activity { $s['verb'] = ACTIVITY_POST; $s['obj_type'] = ACTIVITY_OBJ_NOTE; - $instrument = $act->get_property_obj('instrument'); - if(! $instrument) - $instrument = $act->get_property_obj('instrument',$act->obj); + $generator = $act->get_property_obj('generator'); + if(! $generator) + $generator = $act->get_property_obj('generator',$act->obj); - if($instrument && array_key_exists('type',$instrument) - && $instrument['type'] === 'Service' && array_key_exists('name',$instrument)) { - $s['app'] = escape_tags($instrument['name']); + if($generator && array_key_exists('type',$generator) + && in_array($generator['type'], [ 'Application','Service' ] ) && array_key_exists('name',$generator)) { + $s['app'] = escape_tags($generator['name']); } if($channel['channel_system']) { @@ -1493,6 +1503,12 @@ class Activity { elseif($act->obj['updated']) { $s['edited'] = datetime_convert('UTC','UTC',$act->obj['updated']); } + if ($act->data['expires']) { + $s['expires'] = datetime_convert('UTC','UTC',$act->data['expires']); + } + elseif ($act->obj['expires']) { + $s['expires'] = datetime_convert('UTC','UTC',$act->obj['expires']); + } if(in_array($act->type, [ 'Like', 'Dislike', 'Flag', 'Block', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'emojiReaction' ])) { @@ -1590,14 +1606,14 @@ class Activity { $s['obj'] = $act->obj; } - $instrument = $act->get_property_obj('instrument'); - if((! $instrument) && (! $response_activity)) { - $instrument = $act->get_property_obj('instrument',$act->obj); + $generator = $act->get_property_obj('generator'); + if((! $generator) && (! $response_activity)) { + $generator = $act->get_property_obj('generator',$act->obj); } - if($instrument && array_key_exists('type',$instrument) - && $instrument['type'] === 'Service' && array_key_exists('name',$instrument)) { - $s['app'] = escape_tags($instrument['name']); + if($generator && array_key_exists('type',$generator) + && in_array($generator['type'], [ 'Application', 'Service' ] ) && array_key_exists('name',$generator)) { + $s['app'] = escape_tags($generator['name']); } diff --git a/Zotlabs/Module/Apschema.php b/Zotlabs/Module/Apschema.php index 5b249bfe8..d217041f2 100644 --- a/Zotlabs/Module/Apschema.php +++ b/Zotlabs/Module/Apschema.php @@ -27,6 +27,7 @@ class Apschema extends \Zotlabs\Web\Controller { 'nomadicLocation' => 'zot:nomadicLocation', 'nomadicHubs' => 'zot:nomadicHubs', 'emojiReaction' => 'zot:emojiReaction', + 'expires' => 'zot:expires', 'magicEnv' => [ '@id' => 'zot:magicEnv', |