diff options
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/stream_entries_helper.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index a1dfe2ecf..ba989a84d 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -1,6 +1,9 @@ # frozen_string_literal: true module StreamEntriesHelper + EMBEDDED_CONTROLLER = 'stream_entries'.freeze + EMBEDDED_ACTION = 'embed'.freeze + def display_name(account) account.display_name.presence || account.username end @@ -10,7 +13,11 @@ module StreamEntriesHelper end def acct(account) - "@#{account.acct}#{embedded_view? && account.local? ? "@#{Rails.configuration.x.local_domain}" : ''}" + if embedded_view? && account.local? + "@#{account.acct}@#{Rails.configuration.x.local_domain}" + else + "@#{account.acct}" + end end def style_classes(status, is_predecessor, is_successor, include_threads) @@ -58,6 +65,6 @@ module StreamEntriesHelper end def embedded_view? - params[:controller] == 'stream_entries' && params[:action] == 'embed' + params[:controller] == EMBEDDED_CONTROLLER && params[:action] == EMBEDDED_ACTION end end |