From 54c7ca58d8aba5fab491a7fe3a0bedd946446e83 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 Oct 2018 03:41:38 +0000 Subject: [PATCH] Repeated posts from OStatus, ActitivyPub and Twitter are now shown as is --- include/api.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index cf5fdc29cd..4cc1753c79 100644 --- a/include/api.php +++ b/include/api.php @@ -4827,8 +4827,18 @@ function api_share_as_retweet(&$item) { $body = trim($item["body"]); - if (Diaspora::isReshare($body, false)===false) { - return false; + if (Diaspora::isReshare($body, false) === false) { + if ($item['author-id'] == $item['owner-id']) { + return false; + } else { + // Reshares from OStatus, ActivityPub and Twitter + $reshared_item = $item; + $reshared_item['owner-id'] = $reshared_item['author-id']; + $reshared_item['owner-link'] = $reshared_item['author-link']; + $reshared_item['owner-name'] = $reshared_item['author-name']; + $reshared_item['owner-avatar'] = $reshared_item['author-avatar']; + return $reshared_item; + } } /// @TODO "$1" should maybe mean '$1' ?