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

28 lines
531 B

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