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/typingStatus.coffee

24 lines
539 B

Meteor.methods
typingStatus: (typingData, start) ->
if not Meteor.userId()
throw new Meteor.Error 203, t('general.User_logged_out')
filter =
t: 't'
rid: typingData.rid
$and: [{'u._id': Meteor.userId()}]
if start
msgData =
'$set':
expireAt: moment().add(30, 'seconds').toDate()
'$setOnInsert':
msg: '...'
'u._id': Meteor.userId()
'u.username': Meteor.user().username
ts: moment().add(1, 'years').toDate()
ChatMessage.upsert(filter, msgData)
else
ChatMessage.remove(filter)