[Room] Fix last message when encrypted

This commit is contained in:
Christian Pauly 2020-02-24 09:10:35 +01:00
parent 0b0facb0e0
commit 63bcce28de

View file

@ -181,6 +181,12 @@ class Room {
"/clients/${client.deviceID}/rooms/${this.id}/session_keys",
json.encode(sessionKeys));
}
if (getState("m.room.encrypted") != null) {
final Event decrypted = getState("m.room.encrypted").decrypted;
if (decrypted.type != EventTypes.Encrypted) {
setState(decrypted);
}
}
onSessionKeyReceived.add(sessionId);
}
@ -210,6 +216,10 @@ class Room {
clearOutboundGroupSession();
}
}
if ((getState(state.typeKey)?.time?.millisecondsSinceEpoch ?? 0) >
state.time.millisecondsSinceEpoch) {
return;
}
if (!states.states.containsKey(state.typeKey)) {
states.states[state.typeKey] = {};
}