From 5cf369c026d6ed9f22fc05da9b97707f2a4592e9 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 28 Sep 2020 14:09:45 +0000 Subject: [PATCH 1/2] Improve resharer information --- include/conversation.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 6f8c28d72..0ceb9e068 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1007,8 +1007,7 @@ function builtin_activity_puller($item, &$conv_responses) { // 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)) { + if (Item::exists(['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'causer-id' => $item['author-id'], 'gravity' => GRAVITY_PARENT])) { continue; } } From 415a3a792688e826c76a7f5b10624e72fd2aeaf8 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 28 Sep 2020 14:13:14 +0000 Subject: [PATCH 2/2] Remove an "if" --- include/conversation.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 0ceb9e068..b984c3da2 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1006,10 +1006,9 @@ function builtin_activity_puller($item, &$conv_responses) { } // Skip when the causer of the parent is the same than the author of the announce - if ($verb == Activity::ANNOUNCE) { - if (Item::exists(['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'causer-id' => $item['author-id'], 'gravity' => GRAVITY_PARENT])) { - continue; - } + if (($verb == Activity::ANNOUNCE) && Item::exists(['uri' => $item['thr-parent'], + 'uid' => $item['uid'], 'causer-id' => $item['author-id'], 'gravity' => GRAVITY_PARENT])) { + continue; } if (!isset($conv_responses[$mode][$item['thr-parent']])) {