From 0d49d0593d9d2ab05d8dd3f3e7d8a5a3eeb43b84 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 19 Apr 2019 07:47:00 +0000 Subject: [PATCH] Don't show a reshare in the top of a message if we know the author --- include/conversation.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/conversation.php b/include/conversation.php index c82bbe58fc..ac2c963036 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -800,6 +800,7 @@ function conversation_fetch_comments($thread_items) { $lineno = 0; $actor = []; $created = ''; + $knownauthor = false; while ($row = Item::fetch($thread_items)) { if (($row['verb'] == ACTIVITY2_ANNOUNCE) && !empty($row['contact-uid']) && ($row['created'] > $created) && ($row['thr-parent'] == $row['parent-uri'])) { @@ -808,6 +809,11 @@ function conversation_fetch_comments($thread_items) { } if ($row['gravity'] == GRAVITY_PARENT) { $parentlines[] = $lineno; + + // We could have several parents, so it has to be done this way. + if (!empty($row['contact-uid']) && in_array($row['network'], Protocol::NATIVE_SUPPORT)) { + $knownauthor = true; + } } $comments[] = $row; @@ -816,7 +822,7 @@ function conversation_fetch_comments($thread_items) { DBA::close($thread_items); - if (!empty($actor)) { + if (!$knownauthor && !empty($actor)) { foreach ($parentlines as $line) { if (!in_array($comments[$line]['network'], [Protocol::DIASPORA]) && !$comments[$line]['origin']) { $comments[$line]['owner-link'] = $actor['link']; -- 2.39.5