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 {
property var flow
property bool isRequest
property var tran_id
title: stack.currentItem.title

View File

@ -64,7 +64,7 @@ Pane {
}
onClicked: {
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;
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;

View File

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