aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-05-28 20:23:03 -0700
committerzotlabs <mike@macgirvin.com>2019-05-28 20:23:03 -0700
commit0fa4c89a1b74879b57fef1e6f785d15d49bd3e30 (patch)
tree9b67f61872df484b8297032d5d7045088b3c9483 /Zotlabs/Lib/Activity.php
parent1bf046c142f3ac43da4a65ec3ad80555e781655f (diff)
downloadvolse-hubzilla-0fa4c89a1b74879b57fef1e6f785d15d49bd3e30.tar.gz
volse-hubzilla-0fa4c89a1b74879b57fef1e6f785d15d49bd3e30.tar.bz2
volse-hubzilla-0fa4c89a1b74879b57fef1e6f785d15d49bd3e30.zip
convert AS "instrument" objects to the more appropriate "generator" - this probably should happen in pubcrawl addon also
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index dc3cff1e7..4a1171c5d 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -299,7 +299,7 @@ class Activity {
}
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' ];
@@ -506,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' ];
@@ -1337,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']) {
@@ -1606,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']);
}