about summary refs log tree commit diff
path: root/app/controllers/api/activitypub/activities_controller.rb
blob: 025ab960e3741793930f986f9348e1581410e408 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

class Api::Activitypub::ActivitiesController < ApiController
  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