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/startup/roomPublishes.coffee

40 lines
952 B

Meteor.startup ->
RocketChat.roomTypes.setPublish 'c', (identifier) ->
options =
fields:
name: 1
t: 1
cl: 1
u: 1
usernames: 1
topic: 1
muted: 1
archived: 1
return RocketChat.models.Rooms.findByTypeAndName 'c', identifier, options
RocketChat.roomTypes.setPublish 'p', (identifier) ->
options =
fields:
name: 1
t: 1
cl: 1
u: 1
usernames: 1
topic: 1
muted: 1
archived: 1
user = RocketChat.models.Users.findOneById this.userId, fields: username: 1
return RocketChat.models.Rooms.findByTypeAndNameContainigUsername 'p', identifier, user.username, options
RocketChat.roomTypes.setPublish 'd', (identifier) ->
options =
fields:
name: 1
t: 1
cl: 1
u: 1
usernames: 1
user = RocketChat.models.Users.findOneById this.userId, fields: username: 1
return RocketChat.models.Rooms.findByTypeContainigUsernames 'd', [user.username, identifier], options