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/packages/rocketchat-message-star/server/publications/starredMessages.coffee

18 lines
581 B

Meteor.publish 'starredMessages', (rid, options = {}) ->
unless this.userId
return this.ready()
console.log '[publish] starredMessages -> '.green, 'rid:', rid, 'options:', options
publication = @
cursorHandle = ChatMessage.find({ 'starred._id': this.userId, rid: rid, _hidden: { $ne: true } }, { sort: { ts: -1 }, limit: 50 }).observeChanges
added: (_id, record) ->
publication.added('rocketchat_starred_message', _id, record)
changed: (_id, record) ->
publication.changed('rocketchat_starred_message', _id, record)
@ready()
@onStop ->
cursorHandle.stop()