Don't display a resharer that was the causer of the post
authorMichael <heluecht@pirati.ca>
Mon, 28 Sep 2020 11:36:47 +0000 (11:36 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Sep 2020 11:36:47 +0000 (11:36 +0000)
include/conversation.php

index c50ce6b..6f8c28d 100644 (file)
@@ -1005,6 +1005,14 @@ function builtin_activity_puller($item, &$conv_responses) {
                                continue;
                        }
 
+                       // Skip when the causer of the parent is the same than the author of the announce
+                       if ($verb == Activity::ANNOUNCE) {
+                               $parent = Item::selectFirst(['causer-id', 'gravity'], ['uri' => $item['thr-parent']]);
+                               if (($parent['causer-id'] == $item['author-id']) && ($parent['gravity'] == GRAVITY_PARENT)) {
+                                       continue;
+                               }
+                       }
+
                        if (!isset($conv_responses[$mode][$item['thr-parent']])) {
                                $conv_responses[$mode][$item['thr-parent']] = 1;
                        } else {