5

I'm trying to get the number of unread messages. This answer provided an answer by adding a date to the rest endpoint. This seems fine but requires you to store a date somewhere which can ofcourse be deleted. However, the rocktchat webclient seems to do it in another way. Deleting the browser history or login in somewhere else will still result in the same number of unread messages. So I guess they are not providing a date? How can I get the number of unread messages without providing a date?

Version of Rocket.Chat Server: 0.61.1

Robin Dijkhof
  • 18,665
  • 11
  • 65
  • 116

1 Answers1

-1

If you have no "updated at" date at hand (cleared history or else) you should probably just pass a very old date in.

probably: var unixTimeZero = Date.parse('01 Jan 1970 00:00:00 GMT');

However you might want to ask the user if he wants to pull the last 2 days, or "all". Maybe "1 week".

Slightly offtopic: Please do this. I use google mail on my android and when I need the latest email, but haven't updated in 3 weeks, I'm getting a looot of mails I don't need. (note: I have auto-sync off)

KYL3R
  • 3,877
  • 1
  • 12
  • 26