mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-06 15:04:52 +00:00
73540ffe6b
* Move ApiController to Api/BaseController * API controllers inherit from Api::BaseController * Add coverage for various error cases in api/base controller
28 lines
592 B
Ruby
28 lines
592 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Api::Activitypub::ActivitiesController < Api::BaseController
|
|
include Authorization
|
|
|
|
# before_action :set_follow, only: [:show_follow]
|
|
before_action :set_status, only: [:show_status]
|
|
|
|
respond_to :activitystreams2
|
|
|
|
# Show a status in AS2 format, as either an Announce (reblog) or a Create (post) activity.
|
|
def show_status
|
|
authorize @status, :show?
|
|
|
|
if @status.reblog?
|
|
render :show_status_announce
|
|
else
|
|
render :show_status_create
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def set_status
|
|
@status = Status.find(params[:id])
|
|
end
|
|
end
|