Lobby timestamps are currently only stored when parsing them in JS, whereas they are cached in C++ with a correct timestamp they are pulled from JS.
So if someone returns from a lobbied game, those historical messages show the date when the user returned to the lobby, not when the messages were sent.
As a side-effect, this breaks the clientside lobby chat message spamfilter, which could be removed (as proposed by D512).
Josh had fixed this in a patch that was committed in rP17928, but it had two issues:
- Forgot to include wposix.
- Used std::time_t while the type of that is not specified, u64 on some platforms which can't be converted to a JS number.
Both issues have a trivial fix.
We can store the timestamp as u64 (the type a timestamp ought to have) but have to use double when converting it to a JS number,
since JS has only one number type which is equivalent to number (see D84, D205).
The same double conversion is used for savegames and replays, so it's not only correct but also consistent with the rest of the code.
The lobby.js part needs to be amended if D512 is rejected.