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/lib/collections.coffee

16 lines
522 B

@UserFullName = {}
@ChatMessage = new Meteor.Collection 'data.ChatMessage'
@ChatRoom = new Meteor.Collection 'data.ChatRoom',
transform: (room) ->
if room.t is 'd' and Meteor.userId()?
if not UserFullName[Meteor.userId()]?
user = Meteor.users.findOne Meteor.userId()
UserFullName[Meteor.userId()] = user.name
regex = new RegExp('\\|?' + UserFullName[Meteor.userId()] + '\\|?')
room.name = room.name.replace(regex, '')
return room
@ChatSubscription = new Meteor.Collection 'data.ChatSubscription'