mirror of
https://github.com/friendica/friendica
synced 2025-04-27 13:10:10 +00:00
Improved direction and protocol detection
This commit is contained in:
parent
b8243689a0
commit
2987070d93
14 changed files with 95 additions and 164 deletions
|
@ -358,6 +358,7 @@ class Receiver
|
|||
$object_data['author'] = JsonLD::fetchElement($activity, 'as:actor', '@id');
|
||||
$object_data['object_id'] = $object_id;
|
||||
$object_data['object_type'] = ''; // Since we don't fetch the object, we don't know the type
|
||||
$object_data['push'] = $push;
|
||||
} elseif (in_array($type, ['as:Add'])) {
|
||||
$object_data = [];
|
||||
$object_data['id'] = JsonLD::fetchElement($activity, '@id');
|
||||
|
@ -365,6 +366,7 @@ class Receiver
|
|||
$object_data['object_id'] = JsonLD::fetchElement($activity, 'as:object', '@id');
|
||||
$object_data['object_type'] = JsonLD::fetchElement($activity['as:object'], '@type');
|
||||
$object_data['object_content'] = JsonLD::fetchElement($activity['as:object'], 'as:content', '@type');
|
||||
$object_data['push'] = $push;
|
||||
} else {
|
||||
$object_data = [];
|
||||
$object_data['id'] = JsonLD::fetchElement($activity, '@id');
|
||||
|
@ -372,6 +374,7 @@ class Receiver
|
|||
$object_data['object_actor'] = JsonLD::fetchElement($activity['as:object'], 'as:actor', '@id');
|
||||
$object_data['object_object'] = JsonLD::fetchElement($activity['as:object'], 'as:object');
|
||||
$object_data['object_type'] = JsonLD::fetchElement($activity['as:object'], '@type');
|
||||
$object_data['push'] = $push;
|
||||
|
||||
// An Undo is done on the object of an object, so we need that type as well
|
||||
if (($type == 'as:Undo') && !empty($object_data['object_object'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue