From b1e6e6957e62f3da3857f42ec6c343cb9660434d Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Sun, 16 Aug 2020 23:18:38 -0500 Subject: [Federation] Include and dereference URI to the root post of threads; dynamically update thread permissions --- app/serializers/rest/status_serializer.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/serializers/rest') diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index dec39ec24..1182d8e80 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, :root attribute :favourited, if: :current_user? attribute :reblogged, if: :current_user? @@ -110,6 +110,10 @@ class REST::StatusSerializer < ActiveModel::Serializer ActivityPub::TagManager.instance.url_for(object) end + def root + object.conversation&.root + end + def favourited if instance_options && instance_options[:relationships] instance_options[:relationships].favourites_map[object.id] || false -- cgit