about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2018-01-17 18:37:09 -0600
committerDavid Yip <yipdw@member.fsf.org>2018-01-17 18:37:09 -0600
commit201e82686f86d06e10afb62184a091417b09d5ad (patch)
tree419565a2dae93e2fa5bd06726265ff1c457dbaa1 /app/controllers/api
parentaa2bf07281ba1e41c9e32a760684c15081524a7c (diff)
parent7badad7797b487b411a2ab34e0f7413741974bb4 (diff)
Merge remote-tracking branch 'origin/master' into merge-upstream
Conflicts:
      app/javascript/styles/mastodon/components.scss
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/timelines/home_controller.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/api/v1/timelines/home_controller.rb b/app/controllers/api/v1/timelines/home_controller.rb
index db6cd8568..bbbcf7f90 100644
--- a/app/controllers/api/v1/timelines/home_controller.rb
+++ b/app/controllers/api/v1/timelines/home_controller.rb
@@ -9,7 +9,11 @@ class Api::V1::Timelines::HomeController < Api::BaseController
 
   def show
     @statuses = load_statuses
-    render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
+
+    render json: @statuses,
+           each_serializer: REST::StatusSerializer,
+           relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
+           status: regeneration_in_progress? ? 206 : 200
   end
 
   private
@@ -57,4 +61,8 @@ class Api::V1::Timelines::HomeController < Api::BaseController
   def pagination_since_id
     @statuses.first.id
   end
+
+  def regeneration_in_progress?
+    Redis.current.exists("account:#{current_account.id}:regeneration")
+  end
 end