From dae7cda4abe135b3bb5fe9cfb3380721a2feb03e Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Wed, 11 Dec 2019 22:00:22 -0600 Subject: move sharekeys & import metadata to own tables --- app/controllers/statuses_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'app/controllers/statuses_controller.rb') 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 -- cgit