2017-04-23 13:21:10 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-06-08 04:09:25 +10:00
|
|
|
class Api::Activitypub::ActivitiesController < Api::BaseController
|
2017-05-30 02:22:22 +10:00
|
|
|
include Authorization
|
|
|
|
|
2017-04-23 13:21:10 +10:00
|
|
|
# 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
|
2017-05-30 02:22:22 +10:00
|
|
|
authorize @status, :show?
|
2017-04-23 13:21:10 +10:00
|
|
|
|
|
|
|
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
|