mirror of
https://github.com/friendica/friendica
synced 2025-05-04 19:44:11 +02:00
Conversation/context is now stored
This commit is contained in:
parent
54cebf5a88
commit
7eb410bed7
11 changed files with 161 additions and 84 deletions
|
@ -1515,26 +1515,6 @@ class Transmitter
|
|||
return $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches the "context" value for a givem item array from the "conversation" table
|
||||
*
|
||||
* @param array $item Item array
|
||||
* @return string with context url
|
||||
* @throws \Exception
|
||||
*/
|
||||
private static function fetchContextURLForItem(array $item): string
|
||||
{
|
||||
$conversation = DBA::selectFirst('conversation', ['conversation-href', 'conversation-uri'], ['item-uri' => $item['parent-uri']]);
|
||||
if (DBA::isResult($conversation) && !empty($conversation['conversation-href'])) {
|
||||
$context_uri = $conversation['conversation-href'];
|
||||
} elseif (DBA::isResult($conversation) && !empty($conversation['conversation-uri'])) {
|
||||
$context_uri = $conversation['conversation-uri'];
|
||||
} else {
|
||||
$context_uri = $item['parent-uri'] . '#context';
|
||||
}
|
||||
return $context_uri;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if the post contains sensitive content ("nsfw")
|
||||
*
|
||||
|
@ -1646,7 +1626,7 @@ class Transmitter
|
|||
$data['url'] = $link ?? $item['plink'];
|
||||
$data['attributedTo'] = $item['author-link'];
|
||||
$data['sensitive'] = self::isSensitive($item['uri-id']);
|
||||
$data['context'] = self::fetchContextURLForItem($item);
|
||||
$data['conversation'] = $data['context'] = $item['conversation'];
|
||||
|
||||
if (!empty($item['title'])) {
|
||||
$data['name'] = BBCode::toPlaintext($item['title'], false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue