about summary refs log tree commit diff
path: root/app/controllers/api/statuses_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/statuses_controller.rb')
-rw-r--r--app/controllers/api/statuses_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/api/statuses_controller.rb b/app/controllers/api/statuses_controller.rb
index 0ef56580c..90e78a542 100644
--- a/app/controllers/api/statuses_controller.rb
+++ b/app/controllers/api/statuses_controller.rb
@@ -6,6 +6,12 @@ class Api::StatusesController < ApiController
     @status = Status.find(params[:id])
   end
 
+  def context
+    @status      = Status.find(params[:id])
+    @ancestors   = @status.ancestors.with_includes.with_counters
+    @descendants = @status.descendants.with_includes.with_counters
+  end
+
   def create
     @status = PostStatusService.new.(current_user.account, params[:status], params[:in_reply_to_id].blank? ? nil : Status.find(params[:in_reply_to_id]), params[:media_ids])
     render action: :show