summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-10-02 12:18:54 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-10-02 12:18:54 +0200
commit54e3c2c96b75052da8249c3ce92065b9ad09f139 (patch)
tree85ff2c4a46738d61fbf1b67cd1a816b53cbaa396 /src
parentClean up verification and key cache a bit (diff)
downloadnheko-54e3c2c96b75052da8249c3ce92065b9ad09f139.tar.xz
Fix verification start to start with request
Diffstat (limited to 'src')
-rw-r--r--src/DeviceVerificationFlow.cpp7
-rw-r--r--src/DeviceVerificationFlow.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/DeviceVerificationFlow.cpp b/src/DeviceVerificationFlow.cpp
index aa8b5b44..7b367de9 100644
--- a/src/DeviceVerificationFlow.cpp
+++ b/src/DeviceVerificationFlow.cpp
@@ -498,14 +498,13 @@ DeviceVerificationFlow::sendVerificationRequest()
         mtx::events::msg::KeyVerificationRequest req;
 
         req.from_device = http::client()->device_id();
-        req.methods.resize(1);
-        req.methods[0] = mtx::events::msg::VerificationMethods::SASv1;
+        req.methods     = {mtx::events::msg::VerificationMethods::SASv1};
 
         if (this->type == DeviceVerificationFlow::Type::ToDevice) {
-                QDateTime CurrentTime = QDateTime::currentDateTimeUtc();
+                QDateTime currentTime = QDateTime::currentDateTimeUtc();
 
                 req.transaction_id = this->transaction_id;
-                req.timestamp      = (uint64_t)CurrentTime.toTime_t();
+                req.timestamp      = (uint64_t)currentTime.toMSecsSinceEpoch();
 
                 mtx::requests::ToDeviceMessages<mtx::events::msg::KeyVerificationRequest> body;
 
diff --git a/src/DeviceVerificationFlow.h b/src/DeviceVerificationFlow.h
index 31d2facc..de7a4567 100644
--- a/src/DeviceVerificationFlow.h
+++ b/src/DeviceVerificationFlow.h
@@ -111,7 +111,7 @@ private:
         // general
         QString userId;
         QString deviceId;
-        Method method;
+        Method method = Method::Emoji;
         Type type;
         bool sender;
         QTimer *timeout = nullptr;