Keyword/phrase filtering (#7905)
* Add keyword filtering GET|POST /api/v1/filters GET|PUT|DELETE /api/v1/filters/:id - Irreversible filters can drop toots from home or notifications - Other filters can hide toots through the client app - Filters use a phrase valid in particular contexts, expiration * Make sure expired filters don't get applied client-side * Add missing API methods * Remove "regex filter" from column settings * Add tests * Add test for FeedManager * Add CustomFilter test * Add UI for managing filters * Add streaming API event to allow syncing filters * Fix tests
This commit is contained in:
parent
fbee9b5ac8
commit
cdb101340a
38 changed files with 530 additions and 72 deletions
|
@ -474,6 +474,22 @@ en:
|
|||
follows: You follow
|
||||
mutes: You mute
|
||||
storage: Media storage
|
||||
filters:
|
||||
contexts:
|
||||
home: Home timeline
|
||||
notifications: Notifications
|
||||
public: Public timelines
|
||||
thread: Conversations
|
||||
edit:
|
||||
title: Edit filter
|
||||
errors:
|
||||
invalid_context: None or invalid context supplied
|
||||
invalid_irreversible: Irreversible filtering only works with home or notifications context
|
||||
index:
|
||||
delete: Delete
|
||||
title: Filters
|
||||
new:
|
||||
title: Add new filter
|
||||
followers:
|
||||
domain: Domain
|
||||
explanation_html: If you want to ensure the privacy of your statuses, you must be aware of who is following you. <strong>Your private statuses are delivered to all instances where you have followers</strong>. You may wish to review them, and remove followers if you do not trust your privacy to be respected by the staff or software of those instances.
|
||||
|
|
|
@ -6,17 +6,20 @@ en:
|
|||
autofollow: People who sign up through the invite will automatically follow you
|
||||
avatar: PNG, GIF or JPG. At most 2MB. Will be downscaled to 400x400px
|
||||
bot: This account mainly performs automated actions and might not be monitored
|
||||
context: One or multiple contexts where the filter should apply
|
||||
digest: Only sent after a long period of inactivity and only if you have received any personal messages in your absence
|
||||
display_name:
|
||||
one: <span class="name-counter">1</span> character left
|
||||
other: <span class="name-counter">%{count}</span> characters left
|
||||
fields: You can have up to 4 items displayed as a table on your profile
|
||||
header: PNG, GIF or JPG. At most 2MB. Will be downscaled to 700x335px
|
||||
irreversible: Filtered toots will disappear irreversibly, even if filter is later removed
|
||||
locale: The language of the user interface, e-mails and push notifications
|
||||
locked: Requires you to manually approve followers
|
||||
note:
|
||||
one: <span class="note-counter">1</span> character left
|
||||
other: <span class="note-counter">%{count}</span> characters left
|
||||
phrase: Will be matched regardless of casing in text or content warning of a toot
|
||||
setting_default_language: The language of your toots can be detected automatically, but it's not always accurate
|
||||
setting_hide_network: Who you follow and who follows you will not be shown on your profile
|
||||
setting_noindex: Affects your public profile and status pages
|
||||
|
@ -39,6 +42,7 @@ en:
|
|||
chosen_languages: Filter languages
|
||||
confirm_new_password: Confirm new password
|
||||
confirm_password: Confirm password
|
||||
context: Filter contexts
|
||||
current_password: Current password
|
||||
data: Data
|
||||
display_name: Display name
|
||||
|
@ -46,6 +50,7 @@ en:
|
|||
expires_in: Expire after
|
||||
fields: Profile metadata
|
||||
header: Header
|
||||
irreversible: Drop instead of hide
|
||||
locale: Interface language
|
||||
locked: Lock account
|
||||
max_uses: Max number of uses
|
||||
|
@ -53,6 +58,7 @@ en:
|
|||
note: Bio
|
||||
otp_attempt: Two-factor code
|
||||
password: Password
|
||||
phrase: Keyword or phrase
|
||||
setting_auto_play_gif: Auto-play animated GIFs
|
||||
setting_boost_modal: Show confirmation dialog before boosting
|
||||
setting_default_language: Posting language
|
||||
|
|
|
@ -16,6 +16,7 @@ SimpleNavigation::Configuration.run do |navigation|
|
|||
settings.item :follower_domains, safe_join([fa_icon('users fw'), t('settings.followers')]), settings_follower_domains_url
|
||||
end
|
||||
|
||||
primary.item :filters, safe_join([fa_icon('filter fw'), t('filters.index.title')]), filters_path, highlights_on: %r{/filters}
|
||||
primary.item :invites, safe_join([fa_icon('user-plus fw'), t('invites.title')]), invites_path, if: proc { Setting.min_invite_role == 'user' }
|
||||
|
||||
primary.item :development, safe_join([fa_icon('code fw'), t('settings.development')]), settings_applications_url do |development|
|
||||
|
|
|
@ -114,6 +114,7 @@ Rails.application.routes.draw do
|
|||
resources :tags, only: [:show]
|
||||
resources :emojis, only: [:show]
|
||||
resources :invites, only: [:index, :create, :destroy]
|
||||
resources :filters, except: [:show]
|
||||
|
||||
get '/media_proxy/:id/(*any)', to: 'media_proxy#show', as: :media_proxy
|
||||
|
||||
|
@ -254,6 +255,7 @@ Rails.application.routes.draw do
|
|||
resources :mutes, only: [:index]
|
||||
resources :favourites, only: [:index]
|
||||
resources :reports, only: [:index, :create]
|
||||
resources :filters, only: [:index, :create, :show, :update, :destroy]
|
||||
|
||||
namespace :apps do
|
||||
get :verify_credentials, to: 'credentials#show'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue