diff options
Diffstat (limited to 'app/serializers/activitypub')
-rw-r--r-- | app/serializers/activitypub/note_serializer.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index 163f25560..b86ab932e 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -3,7 +3,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer context_extensions :atom_uri, :conversation, :sensitive, :voters_count, :direct_message - context_extensions :edited, :server_metadata + context_extensions :edited, :server_metadata, :root attributes :id, :type, :summary, :in_reply_to, :published, :url, @@ -11,7 +11,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer :atom_uri, :in_reply_to_atom_uri, :conversation - attribute :updated + attributes :updated, :root attribute :title, key: :name, if: :title_present? attribute :content @@ -50,6 +50,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer end end + def root + object.conversation&.root + end + def summary return Formatter.instance.format(object) if title_present? |