Fix: #703 NGワード、センシティブワード「無関係なフォロワーへのメンション」が、自分自身へのメンションにも適用される (#704)

This commit is contained in:
KMY(雪あすか) 2024-04-09 09:02:50 +09:00 committed by GitHub
parent c147b6dc37
commit 44af34f306
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 6 deletions

View file

@ -249,12 +249,12 @@ class PostStatusService < BaseService
def mention_to_stranger?
return @mention_to_stranger if defined?(@mention_to_stranger)
@mention_to_stranger = @status.mentions.map(&:account).to_a.any? { |mentioned_account| mentioned_account.id != @account.id && !mentioned_account.following?(@account) } ||
(@in_reply_to && @in_reply_to.account.id != @account.id && !@in_reply_to.account.following?(@account))
@mention_to_stranger = @status.mentions.map(&:account).to_a.any? { |mentioned_account| !mentioned_account.following_or_self?(@account) } ||
(@in_reply_to && !@in_reply_to.account.following_or_self?(@account))
end
def reference_to_stranger?
referred_statuses.any? { |status| !status.account.following?(@account) }
referred_statuses.any? { |status| !status.account.following_or_self?(@account) }
end
def referred_statuses