From a16d46b0d7b89ed468e57642386f2e2b0eea8525 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 21 Nov 2020 15:56:07 -0500 Subject: [PATCH] Move unicity check after array initilization in builtin_activity_puller() - Address https://github.com/friendica/friendica/pull/9569#issuecomment-731613088 - Address https://github.com/friendica/friendica/issues/9251#issuecomment-731615844 --- include/conversation.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 0d21f877ad..8d21039f6a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1034,11 +1034,6 @@ function builtin_activity_puller(array $activity, array &$conv_responses) $activity['thr-parent'] = $activity['parent-uri']; } - // only list each unique author once - if (in_array($link, $conv_responses[$mode][$activity['thr-parent']]['links'])) { - continue; - } - // Skip when the causer of the parent is the same than the author of the announce if (($verb == Activity::ANNOUNCE) && Item::exists(['uri' => $activity['thr-parent'], 'uid' => $activity['uid'], 'causer-id' => $activity['author-id'], 'gravity' => GRAVITY_PARENT])) { @@ -1050,6 +1045,9 @@ function builtin_activity_puller(array $activity, array &$conv_responses) 'links' => [], 'self' => 0, ]; + } elseif (in_array($link, $conv_responses[$mode][$activity['thr-parent']]['links'])) { + // only list each unique author once + continue; } if (public_contact() == $activity['author-id']) {