From 9d4f42fb893c2129aa9f7aa9d012112af3646cae Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Thu, 25 Apr 2019 12:37:40 -0500 Subject: Add option to hide public replies from profile --- app/models/account.rb | 1 + app/models/status.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'app/models') diff --git a/app/models/account.rb b/app/models/account.rb index deeea2f58..c07da2a14 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -48,6 +48,7 @@ # hidden :boolean # hidden :boolean default(FALSE), not null # vars :jsonb not null +# replies :boolean default(TRUE), not null # class Account < ApplicationRecord diff --git a/app/models/status.rb b/app/models/status.rb index eff81cb4e..0baa5c98b 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -432,7 +432,8 @@ class Status < ApplicationRecord visibility = [:public, :unlisted] if account.nil? - where(visibility: visibility).not_local_only + query = where(visibility: visibility).not_local_only + target_account.replies ? query : query.without_replies elsif target_account.blocking?(account) # get rid of blocked peeps none elsif account.id == target_account.id # author can see own stuff -- cgit