Merge branch 'room-fix-decrypt-last-message' into 'master'
[Room] Fix decrypt last message See merge request famedly/famedlysdk!235
This commit is contained in:
commit
eb84c2a085
|
@ -211,13 +211,17 @@ class Room {
|
||||||
"/clients/${client.deviceID}/rooms/${this.id}/session_keys",
|
"/clients/${client.deviceID}/rooms/${this.id}/session_keys",
|
||||||
json.encode(sessionKeys));
|
json.encode(sessionKeys));
|
||||||
}
|
}
|
||||||
|
_tryAgainDecryptLastMessage();
|
||||||
|
onSessionKeyReceived.add(sessionId);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _tryAgainDecryptLastMessage() {
|
||||||
if (getState("m.room.encrypted") != null) {
|
if (getState("m.room.encrypted") != null) {
|
||||||
final Event decrypted = getState("m.room.encrypted").decrypted;
|
final Event decrypted = getState("m.room.encrypted").decrypted;
|
||||||
if (decrypted.type != EventTypes.Encrypted) {
|
if (decrypted.type != EventTypes.Encrypted) {
|
||||||
setState(decrypted);
|
setState(decrypted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onSessionKeyReceived.add(sessionId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the [Event] for the given [typeKey] and optional [stateKey].
|
/// Returns the [Event] for the given [typeKey] and optional [stateKey].
|
||||||
|
@ -917,6 +921,7 @@ class Room {
|
||||||
await client.storeAPI?.setItem(
|
await client.storeAPI?.setItem(
|
||||||
"/clients/${client.deviceID}/rooms/${this.id}/session_keys",
|
"/clients/${client.deviceID}/rooms/${this.id}/session_keys",
|
||||||
json.encode(sessionKeys));
|
json.encode(sessionKeys));
|
||||||
|
_tryAgainDecryptLastMessage();
|
||||||
_fullyRestored = true;
|
_fullyRestored = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue