Merge pull request #9571 from MrPetovan/bug/9549-photo-remove-activity

Move unicity check after array initilization in builtin_activity_puller()
This commit is contained in:
Michael Vogel 2020-11-21 22:36:09 +01:00 committed by GitHub
commit 2dd56bcb0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1034,11 +1034,6 @@ function builtin_activity_puller(array $activity, array &$conv_responses)
$activity['thr-parent'] = $activity['parent-uri']; $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 // 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'], if (($verb == Activity::ANNOUNCE) && Item::exists(['uri' => $activity['thr-parent'],
'uid' => $activity['uid'], 'causer-id' => $activity['author-id'], 'gravity' => GRAVITY_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' => [], 'links' => [],
'self' => 0, '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']) { if (public_contact() == $activity['author-id']) {