fix: Last message sort order

This commit is contained in:
Christian Pauly 2020-09-04 09:48:35 +02:00
parent 9142dcbeec
commit e90793bef1

View file

@ -1104,9 +1104,9 @@ class Client extends MatrixApi {
); );
} else { } else {
var prevState = rooms[j].getState(stateEvent.type, stateEvent.stateKey); var prevState = rooms[j].getState(stateEvent.type, stateEvent.stateKey);
if (prevState != null && if (prevState != null && prevState.sortOrder > stateEvent.sortOrder) {
prevState.originServerTs.millisecondsSinceEpoch > return;
stateEvent.originServerTs.millisecondsSinceEpoch) return; }
rooms[j].setState(stateEvent); rooms[j].setState(stateEvent);
} }
} else if (eventUpdate.type == 'account_data') { } else if (eventUpdate.type == 'account_data') {