Skip to content
Snippets Groups Projects
Commit 6e4046fc authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub
Browse files

Fix #5178 - Use object URI only in Announce, instead of embedding (#5266)

parent f0c939c4
No related branches found
No related tags found
No related merge requests found
......@@ -3,10 +3,11 @@
class ActivityPub::ActivitySerializer < ActiveModel::Serializer
attributes :id, :type, :actor, :published, :to, :cc
has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer
has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer, unless: :announce?
attribute :proper_uri, key: :object, if: :announce?
def id
[ActivityPub::TagManager.instance.activity_uri_for(object)].join
ActivityPub::TagManager.instance.activity_uri_for(object)
end
def type
......@@ -29,6 +30,10 @@ class ActivityPub::ActivitySerializer < ActiveModel::Serializer
ActivityPub::TagManager.instance.cc(object)
end
def proper_uri
ActivityPub::TagManager.instance.uri_for(object.proper)
end
def announce?
object.reblog?
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment