mirror of
https://github.com/friendica/friendica
synced 2025-04-26 09:10:15 +00:00
Process incoming tag add requests
This commit is contained in:
parent
32b1f75ece
commit
ecf4789cc4
2 changed files with 50 additions and 0 deletions
|
@ -226,6 +226,13 @@ 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
|
||||
} elseif (in_array($type, ['as:Add'])) {
|
||||
$object_data = [];
|
||||
$object_data['id'] = JsonLD::fetchElement($activity, '@id');
|
||||
$object_data['target_id'] = JsonLD::fetchElement($activity, 'as:target', '@id');
|
||||
$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');
|
||||
} else {
|
||||
$object_data = [];
|
||||
$object_data['id'] = JsonLD::fetchElement($activity, '@id');
|
||||
|
@ -366,6 +373,12 @@ class Receiver
|
|||
}
|
||||
break;
|
||||
|
||||
case 'as:Add':
|
||||
if ($object_data['object_type'] == 'as:tag') {
|
||||
ActivityPub\Processor::addTag($object_data);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'as:Announce':
|
||||
if (in_array($object_data['object_type'], self::CONTENT_TYPES)) {
|
||||
$profile = APContact::getByURL($object_data['actor']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue