fix: Do not assume a missing timestamp means "now"
This causes issues with state handling as we prefer the newer event. It also has knock-on effects in other places. Instead set such events to have an obviously invalid timestamp, which makes issues easier to identify. This may break invites showing a timestamp or the timestamps for just sent events, if you rely on the timestamp getting set to "now".
This commit is contained in:
parent
23bc6ef465
commit
5ffa99d994
|
|
@ -210,10 +210,8 @@ class Event extends MatrixEvent {
|
|||
type: jsonPayload['type'],
|
||||
eventId: jsonPayload['event_id'] ?? '',
|
||||
senderId: jsonPayload['sender'],
|
||||
originServerTs: jsonPayload['origin_server_ts'] != null
|
||||
? DateTime.fromMillisecondsSinceEpoch(
|
||||
jsonPayload['origin_server_ts'])
|
||||
: DateTime.now(),
|
||||
originServerTs: DateTime.fromMillisecondsSinceEpoch(
|
||||
jsonPayload['origin_server_ts'] ?? 0),
|
||||
unsigned: unsigned,
|
||||
room: room,
|
||||
originalSource: originalSource.isEmpty
|
||||
|
|
|
|||
Loading…
Reference in New Issue