Add ng words for post/update
This commit is contained in:
parent
d4602118fb
commit
c553275381
12 changed files with 110 additions and 2 deletions
|
@ -88,6 +88,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
process_tags
|
||||
process_audience
|
||||
|
||||
return unless valid_status?
|
||||
|
||||
ApplicationRecord.transaction do
|
||||
@status = Status.create!(@params)
|
||||
attach_tags(@status)
|
||||
|
@ -139,6 +141,10 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
}
|
||||
end
|
||||
|
||||
def valid_status?
|
||||
!Admin::NgWord.reject?("#{@params[:spoiler_text]}\n#{@params[:text]}")
|
||||
end
|
||||
|
||||
def reply_to_local_account?
|
||||
accounts_in_audience.any?(&:local?)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue