about summary refs log tree commit diff
path: root/app/presenters/activitypub
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-11 14:52:07 +0100
committerGitHub <noreply@github.com>2022-02-11 14:52:07 +0100
commitd4e6774a0c88931d907f275821eb001e6dd2cb2d (patch)
treee81f6354d6ff9eaed8f984d00237b223cfa817db /app/presenters/activitypub
parent6f38765fccfeeed6c39a3b11962a518cae1cca4c (diff)
Fix Undo Announce sometimes inlining the originally Announced status (#17516)
* Change tests to have more specific expectations on sent ActivityPub payloads

* Check that payload doesn't actually contain the contents of the boosted toot

* Fix Undo Announce sometimes inlining the originally Announced status
Diffstat (limited to 'app/presenters/activitypub')
-rw-r--r--app/presenters/activitypub/activity_presenter.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/presenters/activitypub/activity_presenter.rb b/app/presenters/activitypub/activity_presenter.rb
index 5d174767f..38e8527e8 100644
--- a/app/presenters/activitypub/activity_presenter.rb
+++ b/app/presenters/activitypub/activity_presenter.rb
@@ -4,7 +4,7 @@ class ActivityPub::ActivityPresenter < ActiveModelSerializers::Model
   attributes :id, :type, :actor, :published, :to, :cc, :virtual_object
 
   class << self
-    def from_status(status)
+    def from_status(status, allow_inlining: true)
       new.tap do |presenter|
         presenter.id        = ActivityPub::TagManager.instance.activity_uri_for(status)
         presenter.type      = status.reblog? ? 'Announce' : 'Create'
@@ -15,7 +15,7 @@ class ActivityPub::ActivityPresenter < ActiveModelSerializers::Model
 
         presenter.virtual_object = begin
           if status.reblog?
-            if status.account == status.proper.account && status.proper.private_visibility? && status.local?
+            if allow_inlining && status.account == status.proper.account && status.proper.private_visibility? && status.local?
               status.proper
             else
               ActivityPub::TagManager.instance.uri_for(status.proper)