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/methods/loadMissedMessages.coffee

22 lines
499 B

Meteor.methods
loadMissedMessages: (rid, start) ->
fromId = Meteor.userId()
# console.log '[methods] loadMissedMessages -> '.green, 'fromId:', fromId, 'rid:', rid, 'start:', start
unless Meteor.call 'canAccessRoom', rid, fromId
return false
query =
_hidden: { $ne: true }
rid: rid
ts:
$gt: start
options =
sort:
ts: -1
if not RocketChat.settings.get 'Message_ShowEditedStatus'
options.fields = { ets: 0 }
return ChatMessage.find(query, options).fetch()