mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Add event trigger when a user is logged out.
This commit is contained in:
@@ -854,6 +854,11 @@ class User < ActiveRecord::Base
|
||||
User.where(admin: true).where.not(id: id).where.not(id: Discourse::SYSTEM_USER_ID).blank?
|
||||
end
|
||||
|
||||
def logged_out
|
||||
MessageBus.publish "/logout", self.id, user_ids: [self.id]
|
||||
DiscourseEvent.trigger(:user_logged_out, self)
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def badge_grant
|
||||
@@ -999,7 +1004,6 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
# == Schema Information
|
||||
|
||||
Reference in New Issue
Block a user