Fix verification start to start with request

This commit is contained in:
Nicolas Werner 2020-10-02 12:18:54 +02:00
parent 94690ebd4c
commit 54e3c2c96b
4 changed files with 5 additions and 7 deletions

View File

@ -6,7 +6,6 @@ import im.nheko 1.0
ApplicationWindow { ApplicationWindow {
property var flow property var flow
property bool isRequest
property var tran_id property var tran_id
title: stack.currentItem.title title: stack.currentItem.title

View File

@ -64,7 +64,7 @@ Pane {
} }
onClicked: { onClicked: {
stack.replace(awaitingVerificationRequestAccept); stack.replace(awaitingVerificationRequestAccept);
isRequest?flow.sendVerificationRequest():flow.startVerificationRequest(); } flow.sender ?flow.sendVerificationRequest():flow.startVerificationRequest(); }
} }
} }
} }

View File

@ -498,14 +498,13 @@ DeviceVerificationFlow::sendVerificationRequest()
mtx::events::msg::KeyVerificationRequest req; mtx::events::msg::KeyVerificationRequest req;
req.from_device = http::client()->device_id(); req.from_device = http::client()->device_id();
req.methods.resize(1); req.methods = {mtx::events::msg::VerificationMethods::SASv1};
req.methods[0] = mtx::events::msg::VerificationMethods::SASv1;
if (this->type == DeviceVerificationFlow::Type::ToDevice) { if (this->type == DeviceVerificationFlow::Type::ToDevice) {
QDateTime CurrentTime = QDateTime::currentDateTimeUtc(); QDateTime currentTime = QDateTime::currentDateTimeUtc();
req.transaction_id = this->transaction_id; 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; mtx::requests::ToDeviceMessages<mtx::events::msg::KeyVerificationRequest> body;

View File

@ -111,7 +111,7 @@ private:
// general // general
QString userId; QString userId;
QString deviceId; QString deviceId;
Method method; Method method = Method::Emoji;
Type type; Type type;
bool sender; bool sender;
QTimer *timeout = nullptr; QTimer *timeout = nullptr;