Skip to content
Snippets Groups Projects
Commit b169e70f authored by Gabriel Engel's avatar Gabriel Engel
Browse files

separate collections definitions between server and client

parent dc9c7cb7
No related branches found
No related tags found
No related merge requests found
@UserFullName = {}
@UserAndRoom = new Meteor.Collection null
@ChatMessageHistory = new Meteor.Collection null
@ChatRoom = new Meteor.Collection 'data.ChatRoom'
@ChatSubscription = new Meteor.Collection 'data.ChatSubscription'
@ChatMessage = new Meteor.Collection 'data.ChatMessage'
# ,
# 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
Meteor.startup ->
ChatMessage.find().observe
added: (record) ->
......@@ -10,3 +29,4 @@ Meteor.startup ->
removed: (record) ->
if ChatRoom._collection._docs._map[record.rid]? and not ChatMessageHistory._collection._docs._map[record._id]?
ChatMessageHistory.insert record
File moved
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