Make sure the time attribute for MAM message is parsed through moment
Messages (received directly or via MAM) are stored in a backbone collection that's kept sorted by the message's "time" attribute. Various parts of the codebase rely on this behavior. For regular messages, the time attribute is generated by `moment().format()`, which generates a timestamp in the browser's local timezone, for example "...+02:00". For MAM messages, we would previously copy the "delay.stamp" value into the "time" attribute verbatim. However, that value is generated by the server and is unlikely to be in the same timezone locale. ISO timestamps expressed in different timezones cannot be sorted lexicographically, breaking the premise of keeping the messages collection sorted by time.
Showing
Please register or sign in to comment