about summary refs log tree commit diff
path: root/app/serializers/activitypub
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-07-23 18:34:48 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:15 -0500
commit980339b73e294e39b8fd650b5a4c25f39b31d00e (patch)
treee1040f17abf27e4adb05c7bb678f91aefeb09dbc /app/serializers/activitypub
parent47584d20c5c91189f0791b4b63ace361a25b614f (diff)
[Federation] Add backend support for ActivityPub object titles
Diffstat (limited to 'app/serializers/activitypub')
-rw-r--r--app/serializers/activitypub/note_serializer.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb
index 87d7f9db0..75a38e9b5 100644
--- a/app/serializers/activitypub/note_serializer.rb
+++ b/app/serializers/activitypub/note_serializer.rb
@@ -12,6 +12,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
              :conversation
 
   attribute :updated
+  attribute :title, if: :title_present?
 
   attribute :content
   attribute :content_map, if: :language?
@@ -184,6 +185,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
     object.preloadable_poll&.voters_count
   end
 
+  def title_present?
+    object.title.present?
+  end
+
   class MediaAttachmentSerializer < ActivityPub::Serializer
     context_extensions :blurhash, :focal_point