diff options
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/activitypub/note_serializer.rb | 5 | ||||
-rw-r--r-- | app/serializers/rest/status_serializer.rb | 2 |
2 files changed, 6 insertions, 1 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 diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index 1db3d50f1..1c4b86c21 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -7,7 +7,7 @@ class REST::StatusSerializer < ActiveModel::Serializer :favourites_count # Monsterfork additions - attributes :updated_at, :edited, :nest_level + attributes :updated_at, :edited, :nest_level, :title attribute :favourited, if: :current_user? attribute :reblogged, if: :current_user? |