Add support for image preview in attachments in ActivityPub\Processor
- Address https://github.com/friendica/friendica/issues/8676#issuecomment-650554955
This commit is contained in:
parent
05bd0d0b67
commit
3894976a2d
|
@ -115,10 +115,22 @@ class Processor
|
|||
continue 2;
|
||||
}
|
||||
|
||||
$item['body'] .= "\n";
|
||||
|
||||
// image is the preview/thumbnail URL
|
||||
if (!empty($attach['image'])) {
|
||||
$item['body'] .= '[url=' . $attach['url'] . ']';
|
||||
$attach['url'] = $attach['image'];
|
||||
}
|
||||
|
||||
if (empty($attach['name'])) {
|
||||
$item['body'] .= "\n[img]" . $attach['url'] . '[/img]';
|
||||
$item['body'] .= '[img]' . $attach['url'] . '[/img]';
|
||||
} else {
|
||||
$item['body'] .= "\n[img=" . $attach['url'] . ']' . $attach['name'] . '[/img]';
|
||||
$item['body'] .= '[img=' . $attach['url'] . ']' . $attach['name'] . '[/img]';
|
||||
}
|
||||
|
||||
if (!empty($attach['image'])) {
|
||||
$item['body'] .= '[/url]';
|
||||
}
|
||||
} elseif ($filetype == 'audio') {
|
||||
if (!empty($activity['source']) && strpos($activity['source'], $attach['url'])) {
|
||||
|
|
Loading…
Reference in a new issue