FEATURE: add composer warning when user haven't been seen in a long time (#18340)

* FEATURE: add composer warning when user haven't been seen in a long time

When a user creates a PM and adds a recipient that hasn't been seen in a
long time then we'll now show a warning in composer indicating that the
user hasn't been seen in a long time.
This commit is contained in:
Arpit Jalan
2022-09-27 22:06:40 +05:30
committed by GitHub
parent 0f5db0838d
commit 2ee721f8aa
10 changed files with 183 additions and 0 deletions

View File

@@ -212,6 +212,10 @@ class ComposerMessagesFinder
}
end
def self.user_not_seen_in_a_while(usernames)
User.where(username_lower: usernames).where("last_seen_at < ?", SiteSetting.pm_warn_user_last_seen_months_ago.months.ago).pluck(:username).sort
end
private
def educate_reply?(type)