diff options
author | Tobias Fella <fella@posteo.de> | 2021-12-09 23:26:24 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-09 23:59:53 +0100 |
commit | 58798ce15f0f235d64f9c34b3f8c013678ebf25f (patch) | |
tree | cf52da0354f63c14adc3ea70d3c18e1b2ece15fc /lib/room.cpp | |
parent | 1f6771c3b14453ae9b6651a9edb1f7778d3f71f3 (diff) | |
download | libquotient-58798ce15f0f235d64f9c34b3f8c013678ebf25f.tar.gz libquotient-58798ce15f0f235d64f9c34b3f8c013678ebf25f.zip |
Ifdef all the things
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index b3a092f3..7d608520 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -68,9 +68,9 @@ #include "e2ee/qolmaccount.h" #include "e2ee/qolmerrors.h" #include "e2ee/qolminboundsession.h" +#include "database.h" #endif // Quotient_E2EE_ENABLED -#include "database.h" using namespace Quotient; using namespace std::placeholders; @@ -2593,6 +2593,7 @@ Room::Changes Room::Private::addNewMessageEvents(RoomEvents&& events) QElapsedTimer et; et.start(); +#ifdef Quotient_E2EE_ENABLED for(long unsigned int i = 0; i < events.size(); i++) { if(auto* encrypted = eventCast<EncryptedEvent>(events[i])) { auto decrypted = q->decryptMessage(*encrypted); @@ -2604,6 +2605,7 @@ Room::Changes Room::Private::addNewMessageEvents(RoomEvents&& events) } } } +#endif { // Pre-process redactions and edits so that events that get @@ -2758,6 +2760,7 @@ void Room::Private::addHistoricalMessageEvents(RoomEvents&& events) Changes changes {}; +#ifdef Quotient_E2EE_ENABLED for(long unsigned int i = 0; i < events.size(); i++) { if(auto* encrypted = eventCast<EncryptedEvent>(events[i])) { auto decrypted = q->decryptMessage(*encrypted); @@ -2769,6 +2772,7 @@ void Room::Private::addHistoricalMessageEvents(RoomEvents&& events) } } } +#endif // In case of lazy-loading new members may be loaded with historical // messages. Also, the cache doesn't store events with empty content; |