From ece32664ff66de34376e35364587ddca0bd810ab Mon Sep 17 00:00:00 2001 From: Daniel Jalkut Date: Mon, 15 May 2023 11:28:12 -0400 Subject: [PATCH] Add support for a new parameter "client_type", so that API clients may specify whether the API semantics should tend towards defaults that are suitable to an editor or a reader type application. --- app/controllers/api/v1/accounts/statuses_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/accounts/statuses_controller.rb b/app/controllers/api/v1/accounts/statuses_controller.rb index 51f541bd23e..b8c9394b656 100644 --- a/app/controllers/api/v1/accounts/statuses_controller.rb +++ b/app/controllers/api/v1/accounts/statuses_controller.rb @@ -9,7 +9,8 @@ class Api::V1::Accounts::StatusesController < Api::BaseController def index cache_if_unauthenticated! @statuses = load_statuses - render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id) + return_source = params[:client_type] == 'editor' + render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id), source_requested: return_source end private