0
0
Fork 0

Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/controllers/statuses_controller.rb
- app/controllers/stream_entries_controller.rb
This commit is contained in:
Thibaut Girka 2019-06-07 17:00:36 +02:00
commit 34b8346e7f
63 changed files with 239 additions and 535 deletions

View file

@ -17,19 +17,13 @@ class StreamEntriesController < ApplicationController
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
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
@ -57,7 +51,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? || @stream_entry.local_only?