about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorHolly 'Frinkel' Lotor <admin@frinkel.tech>2020-01-22 06:56:17 +0000
committerHolly 'Frinkel' Lotor <admin@frinkel.tech>2020-01-22 01:57:23 -0500
commit4c146300ffaccd3a30c587d1e9166d69ef493417 (patch)
tree35dd9764bafc6b095fe4f0c9ba57d99fa1ff8d1f /app
parent8b96e669e93fc2c82c334b8085be7921f726ba60 (diff)
Fix change breaking sharekey functionality
Diffstat (limited to 'app')
-rw-r--r--app/controllers/statuses_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb
index 1e7adb7da..f95f1dfe0 100644
--- a/app/controllers/statuses_controller.rb
+++ b/app/controllers/statuses_controller.rb
@@ -67,7 +67,13 @@ class StatusesController < ApplicationController
 
   def set_status
     @status = @account.statuses.find(params[:id])
-    authorize @status, :show?
+    @sharekey = params[:key]
+
+    if @status.sharekey.present? && @sharekey == @status.sharekey.key
+      skip_authorization
+    else
+      authorize @status, :show?
+    end
   rescue Mastodon::NotPermittedError
     raise ActiveRecord::RecordNotFound
   end