]> git.mxchange.org Git - friendica.git/commitdiff
Suppress "reshared" information for forum posts
authorMichael <heluecht@pirati.ca>
Mon, 10 Aug 2020 08:26:09 +0000 (08:26 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 10 Aug 2020 08:26:09 +0000 (08:26 +0000)
include/conversation.php

index 86af3b69d496902c71aab1c4a6c414056c1a9ded..8969bfd4b6d215c9c04130b34952fd596dd6c7f6 100644 (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;