Alternative handling of private self-boosts (#9998)
* When self-boosting, embed original toot into Announce serialization * Process unknown self-boosts from Announce object if it is more than an URI * Add some self-boost specs * Only serialize private toots in self-Announces
This commit is contained in:
parent
169b9d4428
commit
6a5307a573
5 changed files with 86 additions and 26 deletions
|
@ -3,8 +3,8 @@
|
|||
class ActivityPub::ActivitySerializer < ActiveModel::Serializer
|
||||
attributes :id, :type, :actor, :published, :to, :cc
|
||||
|
||||
has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer, unless: :announce?
|
||||
attribute :proper_uri, key: :object, if: :announce?
|
||||
has_one :proper, key: :object, serializer: ActivityPub::NoteSerializer, unless: :owned_announce?
|
||||
attribute :proper_uri, key: :object, if: :owned_announce?
|
||||
attribute :atom_uri, if: :announce?
|
||||
|
||||
def id
|
||||
|
@ -42,4 +42,8 @@ class ActivityPub::ActivitySerializer < ActiveModel::Serializer
|
|||
def announce?
|
||||
object.reblog?
|
||||
end
|
||||
|
||||
def owned_announce?
|
||||
announce? && object.account == object.proper.account && object.proper.private_visibility?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue