The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/lib/UserManager.coffee

27 lines
497 B

@UserManager = new class
users = {}
dep = new Tracker.Dependency
addUser = (userIds) ->
# console.log 'addUser', userIds if window.rocketUserDebug
userIds = [].concat userIds
for userId in userIds
unless users[userId]
users[userId] = 1
dep.changed()
subscribeFn = ->
Meteor.subscribe 'selectiveUsers', users
subscribe = new DelayedTask subscribeFn, 100, 1000
init = ->
Tracker.autorun ->
dep.depend()
subscribe.run()
init()
addUser: addUser
users: users