From cac9110533374d5d508b62ab5d35136e859b944c Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 5 Jun 2019 14:02:59 +0200 Subject: Cleanup various controllers (#10972) * Remove skip_session! as it is not supported in Rails 5 * Minor cleanup in StreamEntriesController * Remove redundant mark_cacheable! calls --- app/controllers/stream_entries_controller.rb | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'app/controllers/stream_entries_controller.rb') diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb index b75cefa74..0f7e9e0f5 100644 --- a/app/controllers/stream_entries_controller.rb +++ b/app/controllers/stream_entries_controller.rb @@ -15,19 +15,13 @@ class StreamEntriesController < ApplicationController def show respond_to do |format| format.html do - unless user_signed_in? - skip_session! - expires_in 5.minutes, public: true - end + expires_in 5.minutes, public: true unless @stream_entry.hidden? - redirect_to short_account_status_url(params[:account_username], @stream_entry.activity) if @type == 'status' + redirect_to short_account_status_url(params[:account_username], @stream_entry.activity) end format.atom do - unless @stream_entry.hidden? - skip_session! - expires_in 3.minutes, public: true - end + expires_in 3.minutes, public: true unless @stream_entry.hidden? render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.entry(@stream_entry, true)) end @@ -55,7 +49,7 @@ class StreamEntriesController < ApplicationController def set_stream_entry @stream_entry = @account.stream_entries.where(activity_type: 'Status').find(params[:id]) - @type = @stream_entry.activity_type.downcase + @type = 'status' raise ActiveRecord::RecordNotFound if @stream_entry.activity.nil? authorize @stream_entry.activity, :show? if @stream_entry.hidden? -- cgit