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/activitystreams2_builder_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/activitystreams2_builder_helper.rb b/app/helpers/activitystreams2_builder_helper.rb
new file mode 100644
index 000000000..eeada56f2
--- /dev/null
+++ b/app/helpers/activitystreams2_builder_helper.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+module Activitystreams2BuilderHelper
+  # Gets a usable name for an account, using display name or username.
+  def account_name(account)
+    account.display_name.empty? ? account.username : account.display_name
+  end
+end