mirror of
https://github.com/flarum/core.git
synced 2025-10-17 17:56:14 +02:00
Track user "last seen" time and display whether they are online or not
according to their preferences
This commit is contained in:
@@ -18,6 +18,9 @@ export default DS.Model.extend(HasItemLists, {
|
||||
|
||||
joinTime: DS.attr('date'),
|
||||
lastSeenTime: DS.attr('date'),
|
||||
online: Ember.computed('lastSeenTime', function() {
|
||||
return this.get('lastSeenTime') > moment().subtract(5, 'minutes').toDate();
|
||||
}),
|
||||
readTime: DS.attr('date'),
|
||||
unreadNotificationsCount: DS.attr('number'),
|
||||
|
||||
|
Reference in New Issue
Block a user