about summary refs log tree commit diff
path: root/app/controllers/stream_entries_controller.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-07 22:15:44 +0200
committerGitHub <noreply@github.com>2019-06-07 22:15:44 +0200
commit11c28abcfebcf8827f99a86540076347f1a1edff (patch)
treeb5d615001967cf102e88fac86b8ddb3227600109 /app/controllers/stream_entries_controller.rb
parent83600198961cce9bfe82cf0f0c33286703bc86d1 (diff)
parentaec3fa35fda50e7f618dcf8b8f14e78a995583f4 (diff)
Merge pull request #1097 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/stream_entries_controller.rb')
-rw-r--r--app/controllers/stream_entries_controller.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb
index 1e16c5157..1ee85592c 100644
--- a/app/controllers/stream_entries_controller.rb
+++ b/app/controllers/stream_entries_controller.rb
@@ -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?