private static function createContent(int $uid, array $application, array $ldactivity): array
{
$object_data = self::processObject($ldactivity['as:object']);
- $item = ClientToServer::processContent($object_data, $application, $uid);
+ $item = ClientToServer::processContent($object_data, $application, $uid);
Logger::debug('Got data', ['item' => $item, 'object' => $object_data]);
$id = Item::insert($item, true);
*/
private static function updateContent(int $uid, string $object_id, array $application, array $ldactivity):array
{
- $id = Item::fetchByLink($object_id, $uid);
+ $id = Item::fetchByLink($object_id, $uid);
$original_post = Post::selectFirst(['uri-id'], ['uid' => $uid, 'origin' => true, 'id' => $id]);
if (empty($original_post)) {
Logger::debug('Item not found or does not belong to the user', ['id' => $id, 'uid' => $uid, 'object_id' => $object_id, 'activity' => $ldactivity]);
}
$object_data = self::processObject($ldactivity['as:object']);
- $item = ClientToServer::processContent($object_data, $application, $uid);
+ $item = ClientToServer::processContent($object_data, $application, $uid);
if (empty($item['title']) && empty($item['body'])) {
Logger::debug('Empty body and title', ['id' => $id, 'uid' => $uid, 'object_id' => $object_id, 'activity' => $ldactivity]);
return [];
$item['uid'] = $uid;
$item['verb'] = Activity::POST;
$item['contact-id'] = $owner['id'];
- $item['author-id'] = $item['owner-id'] = Contact::getPublicIdByUserId($uid);
+ $item['author-id'] = $item['owner-id'] = Contact::getPublicIdByUserId($uid);
$item['title'] = $object_data['name'];
$item['body'] = Markdown::toBBCode($object_data['content']);
$item['app'] = $application['name'] ?? 'API';
$item['allow_gid'] = '<' . Group::FOLLOWERS . '>';
$item['deny_cid'] = '';
$item['deny_gid'] = '';
- $item['private'] = Item::PRIVATE;
+ $item['private'] = Item::PRIVATE;
} else {
// @todo Set permissions via the $object_data['target'] array
$item['allow_cid'] = '<' . $owner['id'] . '>';
$item['allow_gid'] = '';
$item['deny_cid'] = '';
$item['deny_gid'] = '';
- $item['private'] = Item::PRIVATE;
+ $item['private'] = Item::PRIVATE;
}
if (!empty($object_data['summary'])) {
if ($object_data['reply-to-id']) {
$item['thr-parent'] = $object_data['reply-to-id'];
- $item['gravity'] = Item::GRAVITY_COMMENT;
+ $item['gravity'] = Item::GRAVITY_COMMENT;
} else {
$item['gravity'] = Item::GRAVITY_PARENT;
}