API: photos are now directly stored as attached data and not in the body anymore

This commit is contained in:
Michael 2021-05-01 15:48:19 +00:00
parent 60f0af3daa
commit 4b12c54345
6 changed files with 89 additions and 54 deletions

View file

@ -112,6 +112,10 @@ class Delayed
*/
public static function publish(array $item, int $notify = 0, array $taglist = [], array $attachments = [], bool $unprepared = false, string $uri = '')
{
if (!empty($attachments)) {
$item['attachments'] = $attachments;
}
if ($unprepared) {
$_SESSION['authenticated'] = true;
$_SESSION['uid'] = $item['uid'];
@ -157,11 +161,6 @@ class Delayed
foreach ($taglist as $tag) {
Tag::store($feeditem['uri-id'], Tag::HASHTAG, $tag);
}
foreach ($attachments as $attachment) {
$attachment['uri-id'] = $feeditem['uri-id'];
Media::insert($attachment);
}
}
return $id;