mirror of
https://github.com/friendica/friendica
synced 2025-05-22 23:04:12 +02:00
Fix attachment handling
This commit is contained in:
parent
e01bda56c5
commit
d6c97dbde2
4 changed files with 29 additions and 50 deletions
|
@ -401,7 +401,16 @@ class Feed
|
|||
}
|
||||
|
||||
if (!empty($href)) {
|
||||
$attachments[] = ['type' => Post\Media::DOCUMENT, 'url' => $href, 'mimetype' => $type, 'size' => $length];
|
||||
$attachment = ['type' => Post\Media::UNKNOWN, 'url' => $href, 'mimetype' => $type, 'size' => $length];
|
||||
|
||||
$attachment = Post\Media::fetchAdditionalData($attachment);
|
||||
|
||||
// By now we separate the visible media types (audio, video, image) from the rest
|
||||
// In the future we should try to avoid the DOCUMENT type and only use the real one - but not in the RC phase.
|
||||
if (!in_array($attachment['type'], [Post\Media::AUDIO, Post\Media::IMAGE, Post\Media::VIDEO])) {
|
||||
$attachment['type'] = Post\Media::DOCUMENT;
|
||||
}
|
||||
$attachments[] = $attachment;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue