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

25 lines
615 B

Meteor.methods
typingStatus: (typingData, start) ->
if not Meteor.userId()
throw new Meteor.Error 203, '[methods] typingStatus -> Usuário não logado'
fromId = Meteor.userId()
# console.log '[methods] typingStatus -> '.green, 'fromId:', fromId, 'typingData:', typingData, 'start:', start
filter =
t: 't'
rid: typingData.rid
uid: Meteor.userId()
if start
msgData =
'$set':
expireAt: moment().add(30, 'seconds').toDate()
'$setOnInsert':
msg: '...'
ts: moment().add(1, 'years').toDate()
ChatMessage.upsert(filter, msgData)
else
ChatMessage.remove(filter)