diff options
author | Tobias Fella <fella@posteo.de> | 2022-02-26 18:48:53 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2022-02-26 18:59:59 +0100 |
commit | ccff9edb1c7102cfcc846561a3bdc41fc1496df9 (patch) | |
tree | 7dceaf3006c494d5049477b2f04baaa44091dc4d | |
parent | 62039b527507aa6c45fbf7ac787da6234d2faac3 (diff) | |
download | libquotient-ccff9edb1c7102cfcc846561a3bdc41fc1496df9.tar.gz libquotient-ccff9edb1c7102cfcc846561a3bdc41fc1496df9.zip |
Handle to-device messages before handling roomdata
Probably improves the performance slightly
If we handle to room data first, if a message arrives at the same time as the to-device message containing the key and we handle the message first, it will not be decryptable and stored as undecrypted. Then, when the key is handled, the cache of undecrypted messages is searched, the message decrypted and replaced.
When handling the key first, the message can be decryped instantly.
-rw-r--r-- | lib/connection.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 66df1e43..7099c59c 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -777,11 +777,11 @@ void Connection::onSyncSuccess(SyncData&& data, bool fromCache) d->consumeDevicesList(data.takeDevicesList()); #endif // Quotient_E2EE_ENABLED + d->consumeToDeviceEvents(data.takeToDeviceEvents()); d->data->setLastEvent(data.nextBatch()); d->consumeRoomData(data.takeRoomData(), fromCache); d->consumeAccountData(data.takeAccountData()); d->consumePresenceData(data.takePresenceData()); - d->consumeToDeviceEvents(data.takeToDeviceEvents()); #ifdef Quotient_E2EE_ENABLED if(d->encryptionUpdateRequired) { d->loadOutdatedUserDevices(); |