Block account bio with ng_words
This commit is contained in:
parent
266823643e
commit
bfdc7c41f2
1 changed files with 8 additions and 0 deletions
|
@ -21,6 +21,8 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
@domain = TagManager.instance.normalize_domain(domain)
|
||||
@collections = {}
|
||||
|
||||
return unless valid_account?
|
||||
|
||||
# The key does not need to be unguessable, it just needs to be somewhat unique
|
||||
@options[:request_id] ||= "#{Time.now.utc.to_i}-#{username}@#{domain}"
|
||||
|
||||
|
@ -123,6 +125,12 @@ class ActivityPub::ProcessAccountService < BaseService
|
|||
@account.settings = other_settings
|
||||
end
|
||||
|
||||
def valid_account?
|
||||
display_name = @json['name']
|
||||
note = @json['summary']
|
||||
!Admin::NgWord.reject?(display_name) && !Admin::NgWord.reject?(note)
|
||||
end
|
||||
|
||||
def set_fetchable_key!
|
||||
@account.public_key = public_key || ''
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue