about summary refs log tree commit diff
path: root/app/lib
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/lib
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/lib')
-rw-r--r--app/lib/activitypub/tag_manager.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb
index 3c16006cb..de575d9e6 100644
--- a/app/lib/activitypub/tag_manager.rb
+++ b/app/lib/activitypub/tag_manager.rb
@@ -19,6 +19,7 @@ class ActivityPub::TagManager
     when :person
       short_account_url(target)
     when :note, :comment, :activity
+      return activity_account_status_url(target.account, target) if target.reblog?
       short_account_status_url(target.account, target)
     end
   end
@@ -30,10 +31,17 @@ class ActivityPub::TagManager
     when :person
       account_url(target)
     when :note, :comment, :activity
+      return activity_account_status_url(target.account, target) if target.reblog?
       account_status_url(target.account, target)
     end
   end
 
+  def activity_uri_for(target)
+    return nil unless %i(note comment activity).include?(target.object_type) && target.local?
+
+    activity_account_status_url(target.account, target)
+  end
+
   # Primary audience of a status
   # Public statuses go out to primarily the public collection
   # Unlisted and private statuses go out primarily to the followers collection