about summary refs log tree commit diff
path: root/app/controllers/api/v1/timelines
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-11 02:41:35 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-11 02:41:35 -0600
commitff67dbed2b2878ba0d8032bdde08e06bc0eead3e (patch)
tree805919a162596e67dc8803f9db7892eefc289ea4 /app/controllers/api/v1/timelines
parentd9a9a18afae94ec0a2160e746265e47d7b639eaf (diff)
pass monsterfork api exposure setting to all serializers + add `MONSTERFORK_API_FORCE_*` env vars to set api compatability modes for clients/apps
Diffstat (limited to 'app/controllers/api/v1/timelines')
-rw-r--r--app/controllers/api/v1/timelines/direct_controller.rb2
-rw-r--r--app/controllers/api/v1/timelines/home_controller.rb1
-rw-r--r--app/controllers/api/v1/timelines/list_controller.rb3
-rw-r--r--app/controllers/api/v1/timelines/public_controller.rb2
-rw-r--r--app/controllers/api/v1/timelines/tag_controller.rb2
5 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/api/v1/timelines/direct_controller.rb b/app/controllers/api/v1/timelines/direct_controller.rb
index d8a76d153..e6c2a1a1d 100644
--- a/app/controllers/api/v1/timelines/direct_controller.rb
+++ b/app/controllers/api/v1/timelines/direct_controller.rb
@@ -9,7 +9,7 @@ class Api::V1::Timelines::DirectController < 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), monsterfork_api: monsterfork_api
   end
 
   private
diff --git a/app/controllers/api/v1/timelines/home_controller.rb b/app/controllers/api/v1/timelines/home_controller.rb
index 589bc3486..81a42cb06 100644
--- a/app/controllers/api/v1/timelines/home_controller.rb
+++ b/app/controllers/api/v1/timelines/home_controller.rb
@@ -13,6 +13,7 @@ class Api::V1::Timelines::HomeController < Api::BaseController
     render json: @statuses,
            each_serializer: REST::StatusSerializer,
            relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
+           monsterfork_api: monsterfork_api,
            status: regeneration_in_progress? ? 206 : 200
   end
 
diff --git a/app/controllers/api/v1/timelines/list_controller.rb b/app/controllers/api/v1/timelines/list_controller.rb
index b52f53bf9..1c5030d0e 100644
--- a/app/controllers/api/v1/timelines/list_controller.rb
+++ b/app/controllers/api/v1/timelines/list_controller.rb
@@ -11,7 +11,8 @@ class Api::V1::Timelines::ListController < Api::BaseController
   def show
     render json: @statuses,
            each_serializer: REST::StatusSerializer,
-           relationships: StatusRelationshipsPresenter.new(@statuses, current_user.account_id)
+           relationships: StatusRelationshipsPresenter.new(@statuses, current_user.account_id),
+           monsterfork_api: monsterfork_api
   end
 
   private
diff --git a/app/controllers/api/v1/timelines/public_controller.rb b/app/controllers/api/v1/timelines/public_controller.rb
index 9fee4b362..b9a72b070 100644
--- a/app/controllers/api/v1/timelines/public_controller.rb
+++ b/app/controllers/api/v1/timelines/public_controller.rb
@@ -7,7 +7,7 @@ class Api::V1::Timelines::PublicController < 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), monsterfork_api: monsterfork_api
   end
 
   private
diff --git a/app/controllers/api/v1/timelines/tag_controller.rb b/app/controllers/api/v1/timelines/tag_controller.rb
index 7e60e422b..8bb44a43d 100644
--- a/app/controllers/api/v1/timelines/tag_controller.rb
+++ b/app/controllers/api/v1/timelines/tag_controller.rb
@@ -8,7 +8,7 @@ class Api::V1::Timelines::TagController < 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), monsterfork_api: monsterfork_api
   end
 
   private