mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 13:08:48 +03:00
Add additional device verification logging
This commit is contained in:
parent
d163809551
commit
f38650edf0
1 changed files with 10 additions and 0 deletions
|
@ -94,6 +94,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(timeout, &QTimer::timeout, this, [this]() {
|
connect(timeout, &QTimer::timeout, this, [this]() {
|
||||||
|
nhlog::crypto()->info("verification: timeout");
|
||||||
if (state_ != Success && state_ != Failed)
|
if (state_ != Success && state_ != Failed)
|
||||||
this->cancelVerification(DeviceVerificationFlow::Error::Timeout);
|
this->cancelVerification(DeviceVerificationFlow::Error::Timeout);
|
||||||
});
|
});
|
||||||
|
@ -106,6 +107,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
|
||||||
&ChatPage::receivedDeviceVerificationAccept,
|
&ChatPage::receivedDeviceVerificationAccept,
|
||||||
this,
|
this,
|
||||||
[this](const mtx::events::msg::KeyVerificationAccept &msg) {
|
[this](const mtx::events::msg::KeyVerificationAccept &msg) {
|
||||||
|
nhlog::crypto()->info("verification: received accept");
|
||||||
if (msg.transaction_id.has_value()) {
|
if (msg.transaction_id.has_value()) {
|
||||||
if (msg.transaction_id.value() != this->transaction_id)
|
if (msg.transaction_id.value() != this->transaction_id)
|
||||||
return;
|
return;
|
||||||
|
@ -137,6 +139,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
|
||||||
&ChatPage::receivedDeviceVerificationCancel,
|
&ChatPage::receivedDeviceVerificationCancel,
|
||||||
this,
|
this,
|
||||||
[this](const mtx::events::msg::KeyVerificationCancel &msg) {
|
[this](const mtx::events::msg::KeyVerificationCancel &msg) {
|
||||||
|
nhlog::crypto()->info("verification: received cancel");
|
||||||
if (msg.transaction_id.has_value()) {
|
if (msg.transaction_id.has_value()) {
|
||||||
if (msg.transaction_id.value() != this->transaction_id)
|
if (msg.transaction_id.value() != this->transaction_id)
|
||||||
return;
|
return;
|
||||||
|
@ -153,6 +156,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
|
||||||
&ChatPage::receivedDeviceVerificationKey,
|
&ChatPage::receivedDeviceVerificationKey,
|
||||||
this,
|
this,
|
||||||
[this](const mtx::events::msg::KeyVerificationKey &msg) {
|
[this](const mtx::events::msg::KeyVerificationKey &msg) {
|
||||||
|
nhlog::crypto()->info("verification: received key");
|
||||||
if (msg.transaction_id.has_value()) {
|
if (msg.transaction_id.has_value()) {
|
||||||
if (msg.transaction_id.value() != this->transaction_id)
|
if (msg.transaction_id.value() != this->transaction_id)
|
||||||
return;
|
return;
|
||||||
|
@ -218,6 +222,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
|
||||||
&ChatPage::receivedDeviceVerificationMac,
|
&ChatPage::receivedDeviceVerificationMac,
|
||||||
this,
|
this,
|
||||||
[this](const mtx::events::msg::KeyVerificationMac &msg) {
|
[this](const mtx::events::msg::KeyVerificationMac &msg) {
|
||||||
|
nhlog::crypto()->info("verification: received mac");
|
||||||
if (msg.transaction_id.has_value()) {
|
if (msg.transaction_id.has_value()) {
|
||||||
if (msg.transaction_id.value() != this->transaction_id)
|
if (msg.transaction_id.value() != this->transaction_id)
|
||||||
return;
|
return;
|
||||||
|
@ -377,6 +382,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
|
||||||
&ChatPage::receivedDeviceVerificationReady,
|
&ChatPage::receivedDeviceVerificationReady,
|
||||||
this,
|
this,
|
||||||
[this](const mtx::events::msg::KeyVerificationReady &msg) {
|
[this](const mtx::events::msg::KeyVerificationReady &msg) {
|
||||||
|
nhlog::crypto()->info("verification: received ready");
|
||||||
if (!sender) {
|
if (!sender) {
|
||||||
if (msg.from_device != http::client()->device_id()) {
|
if (msg.from_device != http::client()->device_id()) {
|
||||||
error_ = User;
|
error_ = User;
|
||||||
|
@ -404,6 +410,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
|
||||||
&ChatPage::receivedDeviceVerificationDone,
|
&ChatPage::receivedDeviceVerificationDone,
|
||||||
this,
|
this,
|
||||||
[this](const mtx::events::msg::KeyVerificationDone &msg) {
|
[this](const mtx::events::msg::KeyVerificationDone &msg) {
|
||||||
|
nhlog::crypto()->info("verification: receoved done");
|
||||||
if (msg.transaction_id.has_value()) {
|
if (msg.transaction_id.has_value()) {
|
||||||
if (msg.transaction_id.value() != this->transaction_id)
|
if (msg.transaction_id.value() != this->transaction_id)
|
||||||
return;
|
return;
|
||||||
|
@ -667,6 +674,9 @@ DeviceVerificationFlow::sendVerificationRequest()
|
||||||
void
|
void
|
||||||
DeviceVerificationFlow::cancelVerification(DeviceVerificationFlow::Error error_code)
|
DeviceVerificationFlow::cancelVerification(DeviceVerificationFlow::Error error_code)
|
||||||
{
|
{
|
||||||
|
if (state_ == State::Success || state_ == State::Failed)
|
||||||
|
return;
|
||||||
|
|
||||||
mtx::events::msg::KeyVerificationCancel req;
|
mtx::events::msg::KeyVerificationCancel req;
|
||||||
|
|
||||||
if (error_code == DeviceVerificationFlow::Error::UnknownMethod) {
|
if (error_code == DeviceVerificationFlow::Error::UnknownMethod) {
|
||||||
|
|
Loading…
Reference in a new issue