aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 66df1e43..b585fcc6 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -274,10 +274,10 @@ public:
QString decrypted;
int type = personalCipherObject.value(TypeKeyL).toInt(-1);
QByteArray body = personalCipherObject.value(BodyKeyL).toString().toLatin1();
- if (type == 0) {
+ if (type == QOlmMessage::PreKey) {
QOlmMessage preKeyMessage(body, QOlmMessage::PreKey);
decrypted = sessionDecryptPrekey(preKeyMessage, senderKey, account);
- } else if (type == 1) {
+ } else if (type == QOlmMessage::General) {
QOlmMessage message(body, QOlmMessage::General);
decrypted = sessionDecryptGeneral(message, senderKey);
}
@@ -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();