#29 Add personal limited_scope

This commit is contained in:
KMY 2023-09-25 20:25:04 +09:00
parent b70576df15
commit 002c4bfe74
8 changed files with 39 additions and 2 deletions

View file

@ -145,6 +145,8 @@ class PostStatusService < BaseService
process_mentions_service.call(@status, limited_type: @status.limited_visibility? ? @limited_scope : '', circle: @circle, save_records: false)
safeguard_mentions!(@status)
@status.limited_scope = :personal if @status.limited_visibility? && !process_mentions_service.mentions?
UpdateStatusExpirationService.new.call(@status)
# The following transaction block is needed to wrap the UPDATEs to
@ -221,7 +223,7 @@ class PostStatusService < BaseService
end
def process_mentions_service
ProcessMentionsService.new
@process_mentions_service ||= ProcessMentionsService.new
end
def process_hashtags_service

View file

@ -24,6 +24,10 @@ class ProcessMentionsService < BaseService
end
end
def mentions?
@current_mentions.present?
end
private
def scan_text!