Add a user_seen DiscourseEvent for plugins to hook into

This commit is contained in:
David Taylor 2017-03-31 23:30:59 +01:00
parent e4b1376146
commit 03373a0e84
1 changed files with 2 additions and 0 deletions

View File

@ -521,6 +521,8 @@ class User < ActiveRecord::Base
# using update_column to avoid the AR transaction
update_column(:last_seen_at, now)
update_column(:first_seen_at, now) unless self.first_seen_at
DiscourseEvent.trigger(:user_seen, self)
end
def self.gravatar_template(email)