summary refs log tree commit diff
path: root/src/Olm.h
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-08-07 23:54:35 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-08-07 23:54:35 +0200
commitb73bd2859ca9c3209f6da9c29346b95548b6b8c9 (patch)
tree1ebcab718c40c77b2ca546fca96e24739197a173 /src/Olm.h
parentShow encryption errors in qml and add request keys button (diff)
downloadnheko-b73bd2859ca9c3209f6da9c29346b95548b6b8c9.tar.xz
Protect against replay attacks
Diffstat (limited to '')
-rw-r--r--src/Olm.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Olm.h b/src/Olm.h
index ac1a1617..ab86ca00 100644
--- a/src/Olm.h
+++ b/src/Olm.h
@@ -81,9 +81,11 @@ encrypt_group_message(const std::string &room_id,
                       const std::string &device_id,
                       nlohmann::json body);
 
+//! Decrypt an event. Use dont_write_db to prevent db writes when already in a write transaction.
 DecryptionResult
 decryptEvent(const MegolmSessionIndex &index,
-             const mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> &event);
+             const mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> &event,
+             bool dont_write_db = false);
 crypto::Trust
 calculate_trust(const std::string &user_id, const std::string &curve25519);