def show
respond_to do |format|
format.html do
- unless user_signed_in?
- skip_session!
- expires_in 10.seconds, public: true
- end
+ use_pack 'public'
+
+ expires_in 10.seconds, public: true if current_account.nil?
@body_classes = 'with-modals'
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])
def show
respond_to do |format|
format.html do
- unless user_signed_in?
- skip_session!
- expires_in 5.minutes, public: true
- end
+ use_pack 'public'
+
+ 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
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