diff --git a/include/conversation.php b/include/conversation.php
index 1c9c37d24a..01139a2cb9 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -708,17 +708,36 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o
*/
function conversation_fetch_comments($thread_items, $pinned) {
$comments = [];
+ $parentlines = [];
+ $lineno = 0;
+ $direction = [];
while ($row = Item::fetch($thread_items)) {
+ if (($row['verb'] == Activity::ANNOUNCE) && ($row['thr-parent'] == $row['parent-uri'])
+ && Contact::isSharing($row['author-id'], $row['uid'])) {
+ $direction = ['direction' => 3, 'title' => DI::l10n()->t('Reshared')];
+ }
+
+ if (($row['gravity'] == GRAVITY_PARENT) && !$row['origin'] && ($row['author-id'] == $row['owner-id'])
+ && !Contact::isSharing($row['author-id'], $row['uid'])) {
+ $parentlines[] = $lineno;
+ }
+
if ($row['gravity'] == GRAVITY_PARENT) {
$row['pinned'] = $pinned;
}
$comments[] = $row;
+ $lineno++;
}
DBA::close($thread_items);
+ if (!empty($direction)) {
+ foreach ($parentlines as $line) {
+ $comments[$line]['direction'] = $direction;
+ }
+ }
return $comments;
}
diff --git a/src/Object/Post.php b/src/Object/Post.php
index a1b3941aef..0f2a0c6518 100644
--- a/src/Object/Post.php
+++ b/src/Object/Post.php
@@ -409,7 +409,9 @@ class Post
}
$direction = [];
- if (DI::config()->get('debug', 'show_direction')) {
+ if (!empty($item['direction'])) {
+ $direction = $item['direction'];
+ } elseif (DI::config()->get('debug', 'show_direction')) {
$conversation = DBA::selectFirst('conversation', ['direction'], ['item-uri' => $item['uri']]);
if (!empty($conversation['direction']) && in_array($conversation['direction'], [1, 2])) {
$title = [1 => DI::l10n()->t('Pushed'), 2 => DI::l10n()->t('Pulled')];
diff --git a/view/theme/frio/templates/sub/direction.tpl b/view/theme/frio/templates/sub/direction.tpl
index be34a1edc9..462f540b35 100644
--- a/view/theme/frio/templates/sub/direction.tpl
+++ b/view/theme/frio/templates/sub/direction.tpl
@@ -5,6 +5,8 @@
{{elseif $direction.direction == 2}}
+ {{elseif $direction.direction == 3}}
+
{{/if}}
{{/if}}