summary refs log tree commit diff
path: root/src/DeviceVerificationFlow.cpp
diff options
context:
space:
mode:
authorChethan2k1 <40890937+Chethan2k1@users.noreply.github.com>2020-09-04 12:02:24 +0530
committerChethan2k1 <40890937+Chethan2k1@users.noreply.github.com>2020-09-04 12:02:24 +0530
commite8eeb480d51b6fc60c9807dd92195e9068582592 (patch)
treee9c707bbbbd62c528339b8104ec456c3473f11c9 /src/DeviceVerificationFlow.cpp
parentMerge branch 'master' into device-verification (diff)
downloadnheko-e8eeb480d51b6fc60c9807dd92195e9068582592.tar.xz
Fix Wrong Emojis Issue in Room Verification
Diffstat (limited to 'src/DeviceVerificationFlow.cpp')
-rw-r--r--src/DeviceVerificationFlow.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/DeviceVerificationFlow.cpp b/src/DeviceVerificationFlow.cpp

index 37866716..ae054af7 100644 --- a/src/DeviceVerificationFlow.cpp +++ b/src/DeviceVerificationFlow.cpp
@@ -28,10 +28,10 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *, connect(this->model_, &TimelineModel::updateFlowEventId, this, - [this](std::string event_id) { + [this](std::string event_id_) { this->relation.rel_type = mtx::common::RelationType::Reference; - this->relation.event_id = event_id; - this->transaction_id = event_id; + this->relation.event_id = event_id_; + this->transaction_id = event_id_; }); } @@ -60,7 +60,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *, msg.hashes.end()) && (std::find(msg.message_authentication_codes.begin(), msg.message_authentication_codes.end(), - "hmac-sha256") != msg.message_authentication_codes.end())) { + "hkdf-hmac-sha256") != msg.message_authentication_codes.end())) { if (std::find(msg.short_authentication_string.begin(), msg.short_authentication_string.end(), mtx::events::msg::SASMethods::Decimal) != @@ -236,11 +236,15 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *, &ChatPage::recievedDeviceVerificationReady, this, [this](const mtx::events::msg::KeyVerificationReady &msg) { - if (!sender && msg.from_device != http::client()->device_id()) { - this->deleteLater(); - emit verificationCanceled(); + if (!sender) { + if (msg.from_device != http::client()->device_id()) { + this->deleteLater(); + emit verificationCanceled(); + } + return; } + if (msg.transaction_id.has_value()) { if (msg.transaction_id.value() != this->transaction_id) return; @@ -353,9 +357,9 @@ DeviceVerificationFlow::setMethod(DeviceVerificationFlow::Method method_) } void -DeviceVerificationFlow::setType(Type type) +DeviceVerificationFlow::setType(Type type_) { - this->type = type; + this->type = type_; } void @@ -367,11 +371,11 @@ DeviceVerificationFlow::setSender(bool sender_) } void -DeviceVerificationFlow::setEventId(std::string event_id) +DeviceVerificationFlow::setEventId(std::string event_id_) { this->relation.rel_type = mtx::common::RelationType::Reference; - this->relation.event_id = event_id; - this->transaction_id = event_id; + this->relation.event_id = event_id_; + this->transaction_id = event_id_; } //! accepts a verification