automatically clear an outbound session, if you are unable to decrypt your own messages

This commit is contained in:
Sorunome 2020-05-18 17:31:40 +02:00
parent 3b1c81b4c7
commit 09da5fa4ca
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 4 additions and 0 deletions

View File

@ -1811,6 +1811,10 @@ class Room {
_storeOutboundGroupSession(); _storeOutboundGroupSession();
decryptedPayload = json.decode(decryptResult.plaintext); decryptedPayload = json.decode(decryptResult.plaintext);
} catch (exception) { } catch (exception) {
// alright, if this was actually by our own outbound group session, we might as well clear it
if ((_outboundGroupSession?.session_id() ?? '') == event.content['session_id']) {
clearOutboundGroupSession(wipe: true);
}
if (exception.toString() == DecryptError.UNKNOWN_SESSION) { if (exception.toString() == DecryptError.UNKNOWN_SESSION) {
decryptedPayload = { decryptedPayload = {
'content': event.content, 'content': event.content,