about summary refs log tree commit diff
path: root/app/helpers/stream_entries_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/stream_entries_helper.rb')
-rw-r--r--app/helpers/stream_entries_helper.rb43
1 files changed, 26 insertions, 17 deletions
diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb
index 6e646ab84..07901889d 100644
--- a/app/helpers/stream_entries_helper.rb
+++ b/app/helpers/stream_entries_helper.rb
@@ -64,24 +64,33 @@ module StreamEntriesHelper
     Setting.hide_followers_count || account.user&.setting_hide_followers_count
   end
 
+  def hide_stats?(account)
+    Setting.hide_stats || account.user&.setting_hide_stats
+  end
+
   def account_description(account)
-    prepend_stats = [
-      [
-        number_to_human(account.statuses_count, strip_insignificant_zeros: true),
-        I18n.t('accounts.posts', count: account.statuses_count),
-      ].join(' '),
-
-      [
-        number_to_human(account.following_count, 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, strip_insignificant_zeros: true),
-        I18n.t('accounts.followers', count: account.followers_count),
-      ].join(' ')
+
+    if hide_stats?(account)
+      prepend_stats = []
+    else
+      prepend_stats = [
+        [
+          number_to_human(account.statuses_count, strip_insignificant_zeros: true),
+          I18n.t('accounts.posts', count: account.statuses_count),
+        ].join(' '),
+
+        [
+          number_to_human(account.following_count, 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, strip_insignificant_zeros: true),
+          I18n.t('accounts.followers', count: account.followers_count),
+        ].join(' ')
+      end
     end
 
     [prepend_stats.join(', '), account.note].join(' · ')