Suppress "reshared" information for forum posts

This commit is contained in:
Michael 2020-08-10 08:26:09 +00:00
parent 62ce87dfe6
commit 1934c149a3

View file

@ -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;