From 03373a0e843b606ef13462424c90cb63d11b507a Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 31 Mar 2017 23:30:59 +0100 Subject: [PATCH] Add a user_seen DiscourseEvent for plugins to hook into --- app/models/user.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index 5a0679508d0..a206e5ac935 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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)