From 1493875ec989ae4d7d124248d67b8f4fa8359d5b Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 23 Aug 2020 15:18:26 +0000 Subject: [PATCH] Speed improvement --- include/conversation.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 447874584..faee8f5b3 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -714,13 +714,15 @@ function conversation_fetch_comments($thread_items, $pinned) { $received = ''; while ($row = Item::fetch($thread_items)) { - if (($row['verb'] == Activity::ANNOUNCE) && ($row['thr-parent'] == $row['parent-uri']) - && ($row['received'] > $received) && Contact::isSharing($row['author-id'], $row['uid'])) { + if (!empty($parentlines) && ($row['verb'] == Activity::ANNOUNCE) + && ($row['thr-parent'] == $row['parent-uri']) && ($row['received'] > $received) + && Contact::isSharing($row['author-id'], $row['uid'])) { $direction = ['direction' => 3, 'title' => DI::l10n()->t('%s reshared this.', $row['author-name'])]; $received = $row['received']; } - if (empty($direction) && ($row['gravity'] == GRAVITY_COMMENT) && Contact::isSharing($row['author-id'], $row['uid'])) { + if (!empty($parentlines) && empty($direction) && ($row['gravity'] == GRAVITY_COMMENT) + && Contact::isSharing($row['author-id'], $row['uid'])) { $direction = ['direction' => 2, 'title' => DI::l10n()->t('%s commented this.', $row['author-name'])]; }