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

22 lines
513 B

Meteor.methods
sendMessage: (msg) ->
Tracker.nonreactive ->
now = new Date(Date.now() + TimeSync.serverOffset())
ChatMessage.upsert { rid: msg.rid, t: 't' },
$set:
ts: now
msg: msg.message
'u.username': Meteor.user().username
$unset:
t: 1
expireAt: 1
updateMessage: (msg) ->
Tracker.nonreactive ->
now = new Date(Date.now() + TimeSync.serverOffset())
ChatMessage.update { _id: msg.id, 'u._id': Meteor.userId() },
$set:
ets: now
msg: msg.message