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

29 lines
879 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 do
  15. headers['Access-Control-Allow-Origin'] = '*'
  16. end
  17. end
  18. end
  19. private
  20. def set_account
  21. @account = Account.find_local!(params[:username])
  22. end
  23. end