diff options
Diffstat (limited to 'app/helpers/accounts_helper.rb')
-rw-r--r-- | app/helpers/accounts_helper.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb index 6301919a9..91c3a116b 100644 --- a/app/helpers/accounts_helper.rb +++ b/app/helpers/accounts_helper.rb @@ -27,8 +27,12 @@ module AccountsHelper end end + def hide_followers_count?(account) + Setting.hide_followers_count || account.user&.settings['hide_followers_count'] + end + def account_description(account) - prepend_str = [ + prepend_stats = [ [ number_to_human(account.statuses_count, precision: 3, strip_insignificant_zeros: true), I18n.t('accounts.posts', count: account.statuses_count), @@ -38,13 +42,15 @@ module AccountsHelper number_to_human(account.following_count, precision: 3, strip_insignificant_zeros: true), I18n.t('accounts.following', count: account.following_count), ].join(' '), + ] - [ + unless hide_followers_count?(account) + prepend_stats << [ number_to_human(account.followers_count, precision: 3, strip_insignificant_zeros: true), I18n.t('accounts.followers', count: account.followers_count), - ].join(' '), - ].join(', ') + ].join(' ') + end - [prepend_str, account.note].join(' · ') + [prepend_stats.join(', '), account.note].join(' · ') end end |