mirror of
https://github.com/friendica/friendica
synced 2025-04-25 18:30:11 +00:00
Moved the share interpretation
This commit is contained in:
parent
1ef5730d3d
commit
ef934db614
2 changed files with 17 additions and 13 deletions
|
@ -3666,19 +3666,10 @@ class Item
|
|||
*/
|
||||
public static function improveSharedDataInBody(array $item): string
|
||||
{
|
||||
if (preg_match('#\[share](.*)\[/share]#', $item['body'], $matches)) {
|
||||
$shared = [
|
||||
'message_id' => $matches[1],
|
||||
'link' => '',
|
||||
'guid' => '',
|
||||
'profile' => '',
|
||||
];
|
||||
} else {
|
||||
$shared = BBCode::fetchShareAttributes($item['body']);
|
||||
if (empty($shared['link']) && empty($shared['message_id'])) {
|
||||
return $item['body'];
|
||||
}
|
||||
}
|
||||
$shared = BBCode::fetchShareAttributes($item['body']);
|
||||
if (empty($shared['link']) && empty($shared['message_id'])) {
|
||||
return $item['body'];
|
||||
}
|
||||
|
||||
$id = self::fetchByLink($shared['link'] ?: $shared['message_id']);
|
||||
Logger::debug('Fetched shared post', ['uri-id' => $item['uri-id'], 'id' => $id, 'author' => $shared['profile'], 'url' => $shared['link'], 'guid' => $shared['guid'], 'uri' => $shared['message_id'], 'callstack' => System::callstack()]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue