]> git.mxchange.org Git - friendica.git/commitdiff
Repeated posts from OStatus, ActitivyPub and Twitter are now shown as is
authorMichael <heluecht@pirati.ca>
Tue, 2 Oct 2018 03:41:38 +0000 (03:41 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 2 Oct 2018 03:41:38 +0000 (03:41 +0000)
include/api.php

index cf5fdc29cd1051a2f9b705441583983786be7fdd..4cc1753c79a35c5dc0c38e8bc7da306a59c55e3f 100644 (file)
@@ -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' ?