Merge pull request #4788 from davidtaylorhq/user_seen_event

Add a user_seen DiscourseEvent for plugins to hook into
This commit is contained in:
Guo Xiang Tan 2017-04-06 12:32:16 +08:00 committed by GitHub
commit 0d67b507dc

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)