diff --git a/resources/qml/device-verification/DeviceVerification.qml b/resources/qml/device-verification/DeviceVerification.qml index e409b0fe..ca980987 100644 --- a/resources/qml/device-verification/DeviceVerification.qml +++ b/resources/qml/device-verification/DeviceVerification.qml @@ -6,7 +6,6 @@ import im.nheko 1.0 ApplicationWindow { property var flow - property bool isRequest property var tran_id title: stack.currentItem.title diff --git a/resources/qml/device-verification/NewVerificationRequest.qml b/resources/qml/device-verification/NewVerificationRequest.qml index d8fc65a0..06b06cff 100644 --- a/resources/qml/device-verification/NewVerificationRequest.qml +++ b/resources/qml/device-verification/NewVerificationRequest.qml @@ -64,7 +64,7 @@ Pane { } onClicked: { stack.replace(awaitingVerificationRequestAccept); - isRequest?flow.sendVerificationRequest():flow.startVerificationRequest(); } + flow.sender ?flow.sendVerificationRequest():flow.startVerificationRequest(); } } } } 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 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;