Fix #4725: Don't mark as spam DMails sent by an user to themselves.

This commit is contained in:
evazion
2021-02-23 19:27:04 -06:00
parent b2a423af64
commit 0cc1dae677
2 changed files with 11 additions and 1 deletions

View File

@@ -165,7 +165,7 @@ class Dmail < ApplicationRecord
end
def autoreport_spam
if is_recipient? && SpamDetector.new(self).spam?
if is_recipient? && !is_sender? && SpamDetector.new(self).spam?
self.is_deleted = true
moderation_reports << ModerationReport.new(creator: User.system, reason: "Spam.")
end