about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/profile_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/profile_helper.rb b/app/helpers/profile_helper.rb
index 5a0d6b31f..2abe67635 100644
--- a/app/helpers/profile_helper.rb
+++ b/app/helpers/profile_helper.rb
@@ -1,2 +1,13 @@
 module ProfileHelper
+  def display_name(account)
+    account.display_name.blank? ? account.username : account.display_name
+  end
+
+  def profile_url(account)
+    account.local? ? super(name: account.username) : account.url
+  end
+
+  def status_url(status)
+    status.local? ? super(name: status.account.username, id: status.stream_entry.id) : status.url
+  end
 end