about summary refs log tree commit diff
path: root/app/controllers/statuses_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/statuses_controller.rb')
-rw-r--r--app/controllers/statuses_controller.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb
index eeece1785..f8e81864c 100644
--- a/app/controllers/statuses_controller.rb
+++ b/app/controllers/statuses_controller.rb
@@ -185,7 +185,7 @@ class StatusesController < ApplicationController
     @type         = @stream_entry.activity_type.downcase
     @sharekey     = params[:key]
 
-    if @status.sharekey.present? && @sharekey == @status.sharekey
+    if @status.sharekey.present? && @sharekey == @status.sharekey.key
       skip_authorization
     elsif @account.block_anon && !user_signed_in?
       raise ActiveRecord::RecordNotFound
@@ -203,11 +203,9 @@ class StatusesController < ApplicationController
     case params[:rekey]
     when '1'
       @status.sharekey = SecureRandom.urlsafe_base64(32)
-      @status.save
       Rails.cache.delete("statuses/#{@status.id}")
     when '0'
       @status.sharekey = nil
-      @status.save
       Rails.cache.delete("statuses/#{@status.id}")
     end
   end