mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
API: photos are now directly stored as attached data and not in the body anymore
This commit is contained in:
parent
60f0af3daa
commit
4b12c54345
6 changed files with 89 additions and 54 deletions
|
@ -21,7 +21,6 @@
|
|||
|
||||
namespace Friendica\Model;
|
||||
|
||||
use Friendica\Content\PageInfo;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Core\Hook;
|
||||
|
@ -960,7 +959,13 @@ class Item
|
|||
self::setOwnerforResharedItem($item);
|
||||
}
|
||||
|
||||
Post\Media::insertFromAttachmentData($item['uri-id'], $item['body']);
|
||||
if (isset($item['attachments'])) {
|
||||
foreach ($item['attachments'] as $attachment) {
|
||||
$attachment['uri-id'] = $item['uri-id'];
|
||||
Post\Media::insert($attachment);
|
||||
}
|
||||
unset($item['attachments']);
|
||||
}
|
||||
|
||||
// Remove all media attachments from the body and store them in the post-media table
|
||||
$item['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $item['raw-body']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue