@ -10,6 +10,8 @@ class AccountsController < ApplicationController
def show
def show
respond_to do | format |
respond_to do | format |
format . html do
format . html do
mark_cacheable! unless user_signed_in?
@body_classes = 'with-modals'
@body_classes = 'with-modals'
@pinned_statuses = [ ]
@pinned_statuses = [ ]
@endorsed_accounts = @account . endorsed_accounts . to_a . sample ( 4 )
@endorsed_accounts = @account . endorsed_accounts . to_a . sample ( 4 )
@ -30,17 +32,21 @@ class AccountsController < ApplicationController
end
end
format . atom do
format . atom do
mark_cacheable!
@entries = @account . stream_entries . where ( hidden : false ) . with_includes . paginate_by_max_id ( PAGE_SIZE , params [ :max_id ] , params [ :since_id ] )
@entries = @account . stream_entries . where ( hidden : false ) . with_includes . paginate_by_max_id ( PAGE_SIZE , params [ :max_id ] , params [ :since_id ] )
render xml : OStatus :: AtomSerializer . render ( OStatus :: AtomSerializer . new . feed ( @account , @entries . reject { | entry | entry . status . nil? } ) )
render xml : OStatus :: AtomSerializer . render ( OStatus :: AtomSerializer . new . feed ( @account , @entries . reject { | entry | entry . status . nil? } ) )
end
end
format . rss do
format . rss do
mark_cacheable!
@statuses = cache_collection ( default_statuses . without_reblogs . without_replies . limit ( PAGE_SIZE ) , Status )
@statuses = cache_collection ( default_statuses . without_reblogs . without_replies . limit ( PAGE_SIZE ) , Status )
render xml : RSS :: AccountSerializer . render ( @account , @statuses )
render xml : RSS :: AccountSerializer . render ( @account , @statuses )
end
end
format . json do
format . json do
skip_session !
mark_cacheable !
render_cached_json ( [ 'activitypub' , 'actor' , @account ] , content_type : 'application/activity+json' ) do
render_cached_json ( [ 'activitypub' , 'actor' , @account ] , content_type : 'application/activity+json' ) do
ActiveModelSerializers :: SerializableResource . new ( @account , serializer : ActivityPub :: ActorSerializer , adapter : ActivityPub :: Adapter )
ActiveModelSerializers :: SerializableResource . new ( @account , serializer : ActivityPub :: ActorSerializer , adapter : ActivityPub :: Adapter )