Merge commit '563fc88821' into kb_migration

This commit is contained in:
KMY 2023-07-25 15:02:53 +09:00
commit 5233e68f13
20 changed files with 183 additions and 22 deletions

View file

@ -18,7 +18,7 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
@request_id = request_id
# Only native types can be updated at the moment
return @status if !expected_type? || already_updated_more_recently?
return @status if !expected_type? || already_updated_more_recently? || !valid_status?
if @status_parser.edited_at.present? && (@status.edited_at.nil? || @status_parser.edited_at > @status.edited_at)
handle_explicit_update!
@ -152,6 +152,10 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
end
end
def valid_status?
!Admin::NgWord.reject?("#{@status_parser.spoiler_text}\n#{@status_parser.text}") && !Admin::NgWord.hashtag_reject?(@tags.size)
end
def update_immediate_attributes!
@status.text = @status_parser.text || ''
@status.spoiler_text = @status_parser.spoiler_text || ''