about summary refs log tree commit diff
path: root/app/serializers/rest
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-16 23:18:38 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:18 -0500
commitb1e6e6957e62f3da3857f42ec6c343cb9660434d (patch)
treee1305ef8cf98aabe10fa58c8bc27d0408c681066 /app/serializers/rest
parentaf0b6f445c597b41e861da9e77f39b4caed3e753 (diff)
[Federation] Include and dereference URI to the root post of threads; dynamically update thread permissions
Diffstat (limited to 'app/serializers/rest')
-rw-r--r--app/serializers/rest/status_serializer.rb6
1 files changed, 5 insertions, 1 deletions
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