about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/lib/tag_manager.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/lib/tag_manager.rb b/app/lib/tag_manager.rb
index c88cf4994..fbe03e10f 100644
--- a/app/lib/tag_manager.rb
+++ b/app/lib/tag_manager.rb
@@ -36,4 +36,15 @@ class TagManager
 
     TagManager.instance.web_domain?(domain)
   end
+
+  def url_for(target)
+    return target.url if target.respond_to?(:local?) && !target.local?
+
+    case target.object_type
+    when :person
+      short_account_url(target)
+    when :note, :comment, :activity
+      short_account_status_url(target.account, target)
+    end
+  end
 end