mirror of
https://github.com/friendica/friendica
synced 2025-04-26 09:10:15 +00:00
The "attach" field is now deprecated
This commit is contained in:
parent
d383f49f1e
commit
43749c3069
14 changed files with 91 additions and 99 deletions
|
@ -135,8 +135,6 @@ class Processor
|
|||
return $item;
|
||||
}
|
||||
|
||||
$item['attach'] = '';
|
||||
|
||||
foreach ($activity['attachments'] as $attach) {
|
||||
switch ($attach['type']) {
|
||||
case 'link':
|
||||
|
@ -189,21 +187,6 @@ class Processor
|
|||
}
|
||||
|
||||
$item['body'] .= "\n[video]" . $attach['url'] . '[/video]';
|
||||
} elseif (!empty($attach['url'])) {
|
||||
if (!empty($item['attach'])) {
|
||||
$item['attach'] .= ',';
|
||||
} else {
|
||||
$item['attach'] = '';
|
||||
}
|
||||
|
||||
$item['attach'] .= Post\Media::getAttachElement(
|
||||
$attach['url'],
|
||||
$attach['length'] ?? 0,
|
||||
$attach['mediaType'] ?? '',
|
||||
$attach['name'] ?? ''
|
||||
);
|
||||
} else {
|
||||
Logger::notice('Unknown attachment', ['attach' => $attach]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -787,6 +770,10 @@ class Processor
|
|||
$object_actor = $object['actor'];
|
||||
} elseif (!empty($object['attributedTo'])) {
|
||||
$object_actor = $object['attributedTo'];
|
||||
if (is_array($object_actor)) {
|
||||
$compacted = JsonLD::compact($object);
|
||||
$object_actor = JsonLD::fetchElement($compacted, 'as:attributedTo', '@id');
|
||||
}
|
||||
} else {
|
||||
// Shouldn't happen
|
||||
$object_actor = '';
|
||||
|
|
|
@ -829,7 +829,6 @@ class Transmitter
|
|||
$mail['gravity'] = ($mail['reply'] ? GRAVITY_COMMENT: GRAVITY_PARENT);
|
||||
|
||||
$mail['event-type'] = '';
|
||||
$mail['attach'] = '';
|
||||
|
||||
$mail['parent'] = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue