diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-12-21 13:22:18 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-12-21 13:22:18 -0600 |
commit | 8312a6e51017498c417070cbcbf115da184b786d (patch) | |
tree | 21adc50927a531cc204bc6abd6165abdf930d3a6 /app/models | |
parent | b8f7ccf22729b77fbb5a44ecda01de5329d07adc (diff) |
add option to use phrase filters as an allow list
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/status.rb | 8 | ||||
-rw-r--r-- | app/models/user.rb | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 8a1680ccf..a47f846a5 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -580,7 +580,13 @@ class Status < ApplicationRecord query = query.in_chosen_languages(account) if account.chosen_languages.present? query = query.reply_not_excluded_by_account(account) unless tag_timeline query = query.mention_not_excluded_by_account(account) - query = query.regex_not_filtered_by_account(account.id) if account.custom_filters.present? + unless account.custom_filters.nil? + if account.user.invert_filters + query = query.regex_filtered_by_account(account.id) + else + query = query.regex_not_filtered_by_account(account.id) + end + end query = query.not_missing_media_desc if account.filter_undescribed? query.merge(account_silencing_filter(account)) end diff --git a/app/models/user.rb b/app/models/user.rb index 59067cb36..f6e1a369d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -41,6 +41,7 @@ # vars :jsonb not null # hide_boosts :boolean # only_known :boolean +# invert_filters :boolean default(FALSE), not null # class User < ApplicationRecord |