Avoid quoting the own post

This commit is contained in:
Michael 2023-09-24 10:18:50 +00:00
parent 3e314d2fc6
commit 1dbc9bd472
6 changed files with 20 additions and 10 deletions

View file

@ -638,7 +638,7 @@ class Item
$body = $item['body'];
}
if (empty($item['quote-uri-id'])) {
if (empty($item['quote-uri-id']) || ($item['quote-uri-id'] == $item['uri-id'])) {
return $body;
}
@ -729,7 +729,7 @@ class Item
*/
public function getSharedPost(array $item, array $fields = []): array
{
if (!empty($item['quote-uri-id'])) {
if (!empty($item['quote-uri-id']) && ($item['quote-uri-id'] != $item['uri-id'])) {
$shared = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id'], 'uid' => [0, $item['uid'] ?? 0]]);
if (is_array($shared)) {
return [
@ -770,7 +770,7 @@ class Item
return $attributes;
}
if (!empty($item['quote-uri-id'])) {
if (!empty($item['quote-uri-id']) && ($item['quote-uri-id'] != $item['uri-id'])) {
$shared = Post::selectFirst(['author-name', 'author-link', 'author-avatar', 'plink', 'created', 'guid', 'uri', 'body'], ['uri-id' => $item['quote-uri-id']]);
if (!empty($shared)) {
return [