summary refs log tree commit diff
path: root/src/Olm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Olm.cpp')
-rw-r--r--src/Olm.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp

index 74fbac9a..6c1d3fdc 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp
@@ -1,11 +1,15 @@ +#include <QObject> #include <variant> #include "Olm.h" #include "Cache.h" +#include "ChatPage.h" #include "Logging.h" #include "MatrixClient.h" #include "Utils.h" +#include <DeviceVerificationFlow.h> +#include <iostream> // only for debugging static const std::string STORAGE_SECRET_KEY("secret"); constexpr auto MEGOLM_ALGO = "m.megolm.v1.aes-sha2"; @@ -27,7 +31,6 @@ handle_to_device_messages(const std::vector<mtx::events::collections::DeviceEven { if (msgs.empty()) return; - nhlog::crypto()->info("received {} to_device messages", msgs.size()); nlohmann::json j_msg; @@ -74,6 +77,24 @@ handle_to_device_messages(const std::vector<mtx::events::collections::DeviceEven e.what(), j_msg.dump(2)); } + } else if (msg_type == to_string(mtx::events::EventType::KeyVerificationAccept)) { + ChatPage::instance()->recievedDeviceVerificationAccept(msg); + std::cout << j_msg.dump(2) << std::endl; + } else if (msg_type == to_string(mtx::events::EventType::KeyVerificationRequest)) { + ChatPage::instance()->recievedDeviceVerificationRequest(msg); + std::cout << j_msg.dump(2) << std::endl; + } else if (msg_type == to_string(mtx::events::EventType::KeyVerificationCancel)) { + ChatPage::instance()->recievedDeviceVerificationCancel(msg); + std::cout << j_msg.dump(2) << std::endl; + } else if (msg_type == to_string(mtx::events::EventType::KeyVerificationKey)) { + ChatPage::instance()->recievedDeviceVerificationKey(msg); + std::cout << j_msg.dump(2) << std::endl; + } else if (msg_type == to_string(mtx::events::EventType::KeyVerificationMac)) { + ChatPage::instance()->recievedDeviceVerificationMac(msg); + std::cout << j_msg.dump(2) << std::endl; + } else if (msg_type == to_string(mtx::events::EventType::KeyVerificationStart)) { + ChatPage::instance()->recievedDeviceVerificationStart(msg); + std::cout << j_msg.dump(2) << std::endl; } else { nhlog::crypto()->warn("unhandled event: {}", j_msg.dump(2)); }