From 1934c149a32cd3844741d531c0c568fbbe192496 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Aug 2020 08:26:09 +0000 Subject: [PATCH] Suppress "reshared" information for forum posts --- include/conversation.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/conversation.php b/include/conversation.php index 86af3b69d4..8969bfd4b6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -712,8 +712,13 @@ function conversation_fetch_comments($thread_items, $pinned) { $lineno = 0; $actor = []; $received = ''; + $owner = ''; while ($row = Item::fetch($thread_items)) { + if (($row['verb'] == Activity::ANNOUNCE) && ($row['author-link'] == $owner)) { + continue; + } + if (($row['verb'] == Activity::ANNOUNCE) && !empty($row['contact-uid']) && ($row['received'] > $received) && ($row['thr-parent'] == $row['parent-uri'])) { $actor = ['link' => $row['author-link'], 'avatar' => $row['author-avatar'], 'name' => $row['author-name']]; $received = $row['received']; @@ -724,6 +729,10 @@ function conversation_fetch_comments($thread_items, $pinned) { $parentlines[] = $lineno; } + if (($row['gravity'] == GRAVITY_PARENT) && ($row['author-link'] != $row['owner-link'])) { + $owner = $row['owner-link']; + } + if ($row['gravity'] == GRAVITY_PARENT) { $row['pinned'] = $pinned; } @@ -765,7 +774,7 @@ function conversation_add_children(array $parents, $block_authors, $order, $uid) $max_comments = DI::config()->get('system', 'max_display_comments', 1000); } - $params = ['order' => ['uid', 'commented' => true]]; + $params = ['order' => ['gravity', 'uid', 'commented' => true]]; if ($max_comments > 0) { $params['limit'] = $max_comments;