From: Thibaut Girka Date: Fri, 7 Jun 2019 15:00:36 +0000 (+0200) Subject: Merge branch 'master' into glitch-soc/merge-upstream X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=34b8346e7f1274d40734f9da3100a4343cf9f81c;p=mastodon.git Merge branch 'master' into glitch-soc/merge-upstream Conflicts: - app/controllers/statuses_controller.rb - app/controllers/stream_entries_controller.rb --- 34b8346e7f1274d40734f9da3100a4343cf9f81c diff --cc app/controllers/statuses_controller.rb index 28eebda28,ef26691b2..66ba260aa --- a/app/controllers/statuses_controller.rb +++ b/app/controllers/statuses_controller.rb @@@ -27,12 -27,7 +27,9 @@@ class StatusesController < ApplicationC def show respond_to do |format| format.html do + use_pack 'public' + - unless user_signed_in? - skip_session! - expires_in 10.seconds, public: true - end + expires_in 10.seconds, public: true if current_account.nil? @body_classes = 'with-modals' @@@ -61,10 -52,8 +54,9 @@@ end def embed + use_pack 'embed' raise ActiveRecord::RecordNotFound if @status.hidden? - skip_session! expires_in 180, public: true response.headers['X-Frame-Options'] = 'ALLOWALL' @autoplay = ActiveModel::Type::Boolean.new.cast(params[:autoplay]) diff --cc app/controllers/stream_entries_controller.rb index 1e16c5157,0f7e9e0f5..1ee85592c --- a/app/controllers/stream_entries_controller.rb +++ b/app/controllers/stream_entries_controller.rb @@@ -15,14 -15,9 +15,11 @@@ class StreamEntriesController < Applica def show respond_to do |format| format.html do + use_pack 'public' + - 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 @@@ -57,10 -49,10 +51,10 @@@ 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? + authorize @stream_entry.activity, :show? if @stream_entry.hidden? || @stream_entry.local_only? rescue Mastodon::NotPermittedError # Reraise in order to get a 404 raise ActiveRecord::RecordNotFound