Implement the ability for instances to define a list of disallowed hashtags (#7176)
The goal here isn't to prevent these hashtags from existing, but just to strongly curtail their usage; The hashtags may still exist in the database via federated status, or from being created prior to this feature.
This commit is contained in:
parent
495303d9b8
commit
60b871d56c
4 changed files with 27 additions and 0 deletions
|
@ -59,6 +59,7 @@ class Status < ApplicationRecord
|
|||
validates :uri, uniqueness: true, presence: true, unless: :local?
|
||||
validates :text, presence: true, unless: -> { with_media? || reblog? }
|
||||
validates_with StatusLengthValidator
|
||||
validates_with DisallowedHashtagsValidator
|
||||
validates :reblog, uniqueness: { scope: :account }, if: :reblog?
|
||||
|
||||
default_scope { recent }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue