diff options
author | ThibG <thib@sitedethib.com> | 2019-03-18 19:54:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-18 19:54:23 +0100 |
commit | b9a998f201913dd1c89ddcb0c4c9e181eb73bfcf (patch) | |
tree | 2d5705651ce83b73900ff3e2ce61d8fef1c1b25d /app/controllers/accounts_controller.rb | |
parent | 6e3a4bcbc70bb33bfb0746cf3b2186ee9f4e6515 (diff) | |
parent | 841b920af5de8e3188111ca4dbea0c5105bde88c (diff) |
Merge pull request #963 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/accounts_controller.rb')
-rw-r--r-- | app/controllers/accounts_controller.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 157ea8569..fcdebb47f 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -11,6 +11,8 @@ class AccountsController < ApplicationController respond_to do |format| format.html do use_pack 'public' + mark_cacheable! unless user_signed_in? + @body_classes = 'with-modals' @pinned_statuses = [] @endorsed_accounts = @account.endorsed_accounts.to_a.sample(4) @@ -31,17 +33,21 @@ class AccountsController < ApplicationController end 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]) render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.feed(@account, @entries.reject { |entry| entry.status.nil? || entry.status.local_only? })) end format.rss do + mark_cacheable! + @statuses = cache_collection(default_statuses.without_reblogs.without_replies.limit(PAGE_SIZE), Status) render xml: RSS::AccountSerializer.render(@account, @statuses) end format.json do - skip_session! + mark_cacheable! render_cached_json(['activitypub', 'actor', @account], content_type: 'application/activity+json') do ActiveModelSerializers::SerializableResource.new(@account, serializer: ActivityPub::ActorSerializer, adapter: ActivityPub::Adapter) |