const PUBLIC = 'https://www.w3.org/ns/activitystreams#Public';
const CONTEXT = ['https://www.w3.org/ns/activitystreams', 'https://w3id.org/security/v1',
['vcard' => 'http://www.w3.org/2006/vcard/ns#',
- 'diaspora' => 'https://diasporafoundation.org#',
+ 'diaspora' => 'https://diasporafoundation.org/ns/',
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag']];
$data = array_merge($data, ActivityPub::createPermissionBlockForItem($item));
if (in_array($data['type'], ['Create', 'Update', 'Announce', 'Delete'])) {
- $data['object'] = self::CreateNote($item);
+ $data['object'] = self::createNote($item);
} elseif ($data['type'] == 'Undo') {
$data['object'] = self::createActivityFromItem($item_id, true);
} else {
}
$data = ['@context' => self::CONTEXT];
- $data = array_merge($data, self::CreateNote($item));
+ $data = array_merge($data, self::createNote($item));
return $data;
}
*
* @return object array
*/
- private static function CreateNote($item)
+ private static function createNote($item)
{
if (!empty($item['title'])) {
$type = 'Article';
$data['content'] = BBCode::convert($item['body'], false, 7);
$data['source'] = ['content' => $item['body'], 'mediaType' => "text/bbcode"];
+
+ if (!empty($item['signed_text']) && ($item['uri'] != $item['thr-parent'])) {
+ $data['diaspora:comment'] = $item['signed_text'];
+ }
+
$data['attachment'] = []; // @ToDo
$data['tag'] = self::createTagList($item);
$data = array_merge($data, ActivityPub::createPermissionBlockForItem($item));
return false;
}
logger('Using already stored item for url ' . $object_id, LOGGER_DEBUG);
- $data = self::CreateNote($item);
+ $data = self::createNote($item);
}
if (empty($data['type'])) {