7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/newsmast_mastodon/api/v1/timelines/feeds_controller.rb', line 7
def show
@statuses = []
username = params[:username]
return render json: { error: "Username is required" }, status: :bad_request unless username.present?
account = Account.find_by(username: username)
return render json: { error: "Account not found" }, status: :not_found unless account.present?
unless Object.const_defined?('ContentFilters::CommunityAdmin') && ContentFilters::CommunityAdmin.exists?(
is_boost_bot: true,
account_id: account.id,
account_status: ContentFilters::CommunityAdmin.account_statuses[:active])
return render json: { error: "Account is not a community admin" }, status: :not_found
end
cache_if_unauthenticated!
@statuses = load_statuses
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
end
|