- // Fetch the original id of the object
- $activity = ActivityPub::fetchContent($announce['id'], $item['uid']);
- if (!empty($activity)) {
- $ldactivity = JsonLD::compact($activity);
- $id = JsonLD::fetchElement($ldactivity, '@id');
- $type = str_replace('as:', '', JsonLD::fetchElement($ldactivity, '@type'));
- if (!empty($id)) {
- if (empty($announce['comment'])) {
- // Pure announce, without a quote
- $data['type'] = 'Announce';
- $data['object'] = $id;
- return $data;
- }
-
- // Quote
- $data['type'] = 'Create';
- $item['body'] = $announce['comment'] . "\n" . $id;
- $data['object'] = self::createNote($item);
-
- /// @todo Finally descide how to implement this in AP. This is a possible way:
- $data['object']['attachment'][] = ['type' => $type, 'id' => $id];
-
- $data['object']['source']['content'] = $orig_body;
- return $data;
- }
+ if (empty($announce['comment'])) {
+ // Pure announce, without a quote
+ $data['type'] = 'Announce';
+ $data['object'] = $announce['id'];
+ return $data;