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/server/publications/userChannels.coffee

19 lines
363 B

Meteor.publish 'userChannels', (userId) ->
unless this.userId
return this.ready()
user = Meteor.users.findOne this.userId
if user.admin isnt true
return this.ready()
query = { "u._id": userId }
console.log '[publish] userChannels'.green, userId
ChatSubscription.find query,
fields:
rid: 1,
name: 1,
t: 1,
u: 1
sort: { t: 1, name: 1 }