3 var recentRoomCore = require('gitter-web-rooms/lib/recent-room-core');
5 function LastTroupeAccessTimesForUserStrategy(options) {
6 this.userId = options.userId || options.currentUserId;
7 this.timesIndexed = null;
10 LastTroupeAccessTimesForUserStrategy.prototype = {
13 .getTroupeLastAccessTimesForUserExcludingHidden(this.userId)
15 .then(function(times) {
16 this.timesIndexed = times;
21 var time = this.timesIndexed[id];
22 // No idea why, but sometimes these dates are converted to JSON as {}, hence the weirdness below
25 time: time ? new Date(time.valueOf()).toISOString() : undefined
29 name: 'LastTroupeAccessTimesForUserStrategy'
32 module.exports = LastTroupeAccessTimesForUserStrategy;