about summary refs log tree commit diff
path: root/app/controllers/statuses_controller.rb
diff options
context:
space:
mode:
authorunarist <m.unarist@gmail.com>2017-08-24 23:21:42 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-08-24 16:21:42 +0200
commitb01a19fe392e0dd16d6b3da3f0b56369f7837cc9 (patch)
treea8b4fe087dc8a3186b875517a84ce23e6bf37019 /app/controllers/statuses_controller.rb
parentc66fe2aeba84af5ab47c20298ddc8dceaf0e179f (diff)
Fetch reblogs as Announce activity instead of Note object (#4672)
* Process Create / Announce activity in FetchRemoteStatusService

* Use activity URL in ActivityPub for reblogs

* Redirect to the original status on StatusesController#show
Diffstat (limited to 'app/controllers/statuses_controller.rb')
-rw-r--r--app/controllers/statuses_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/statuses_controller.rb b/app/controllers/statuses_controller.rb
index aa24f23c9..a9768d092 100644
--- a/app/controllers/statuses_controller.rb
+++ b/app/controllers/statuses_controller.rb
@@ -9,6 +9,7 @@ class StatusesController < ApplicationController
   before_action :set_status
   before_action :set_link_headers
   before_action :check_account_suspension
+  before_action :redirect_to_original, only: [:show]
 
   def show
     respond_to do |format|
@@ -58,4 +59,8 @@ class StatusesController < ApplicationController
   def check_account_suspension
     gone if @account.suspended?
   end
+
+  def redirect_to_original
+    redirect_to ::TagManager.instance.url_for(@status.reblog) if @status.reblog?
+  end
 end