闭社主体 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.

27 lines
813 B

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