]> git.mxchange.org Git - friendica.git/commitdiff
Diaspora: Native reshares only work with toplevel posts
authorMichael <heluecht@pirati.ca>
Sun, 11 Oct 2020 21:45:49 +0000 (21:45 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 11 Oct 2020 21:45:49 +0000 (21:45 +0000)
src/Object/Post.php

index 186ce6b7ccfa68f3ad1f488efe1959ae659d03b0..b1cef57db3132c9e4290dbb81bf263e8df87d511 100644 (file)
@@ -178,6 +178,11 @@ class Post
                $shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE;
                $announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]);
 
+               // On Diaspora only toplevel posts can be reshared
+               if ($announceable && ($item['network'] == Protocol::DIASPORA) && ($item['gravity'] != GRAVITY_PARENT)) {
+                       $announceable = false;
+               }
+
                $edpost = false;
 
                if (local_user()) {