Skip to content
Snippets Groups Projects
Commit 717a1e53 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Comment transform of ChatRoom

parent fde2ab80
No related branches found
No related tags found
No related merge requests found
@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
@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, '')
# regex = new RegExp('\\|?' + UserFullName[Meteor.userId()] + '\\|?')
# room.name = room.name.replace(regex, '')
return room
# return room
@ChatSubscription = new Meteor.Collection 'data.ChatSubscription'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment