闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
933 B

  1. # frozen_string_literal: true
  2. class AccountsController < ApplicationController
  3. include AccountControllerConcern
  4. include SignatureVerification
  5. def show
  6. respond_to do |format|
  7. format.html do
  8. @statuses = @account.statuses.permitted_for(@account, current_account).paginate_by_max_id(20, params[:max_id], params[:since_id])
  9. @statuses = cache_collection(@statuses, Status)
  10. end
  11. format.atom do
  12. @entries = @account.stream_entries.where(hidden: false).with_includes.paginate_by_max_id(20, params[:max_id], params[:since_id])
  13. render xml: Ostatus::AtomSerializer.render(Ostatus::AtomSerializer.new.feed(@account, @entries.to_a))
  14. end
  15. format.json do
  16. render json: @account, serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter
  17. end
  18. end
  19. end
  20. private
  21. def set_account
  22. @account = Account.find_local!(params[:username])
  23. end
  24. end