diff --git a/src/DeviceVerificationFlow.cpp b/src/DeviceVerificationFlow.cpp
index 99fd7bed..79f1de84 100644
--- a/src/DeviceVerificationFlow.cpp
+++ b/src/DeviceVerificationFlow.cpp
@@ -64,7 +64,8 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
}
connect(timeout, &QTimer::timeout, this, [this]() {
- this->cancelVerification(DeviceVerificationFlow::Error::Timeout);
+ if (state_ != Success && state_ != Failed)
+ this->cancelVerification(DeviceVerificationFlow::Error::Timeout);
});
connect(ChatPage::instance(),
@@ -114,7 +115,7 @@ DeviceVerificationFlow::DeviceVerificationFlow(QObject *,
return;
}
error_ = User;
- emit errorChanged();
+ Emit errorChanged();
setState(Failed);
});
diff --git a/src/DeviceVerificationFlow.h b/src/DeviceVerificationFlow.h
index 1fe3919b..a1ceaf80 100644
--- a/src/DeviceVerificationFlow.h
+++ b/src/DeviceVerificationFlow.h
@@ -58,7 +58,7 @@ class DeviceVerificationFlow : public QObject
Q_OBJECT
// Q_CLASSINFO("RegisterEnumClassesUnscoped", "false")
Q_PROPERTY(QString state READ state NOTIFY stateChanged)
- Q_PROPERTY(Error error READ error CONSTANT)
+ Q_PROPERTY(Error error READ error NOTIFY errorChanged)
Q_PROPERTY(QString userId READ getUserId CONSTANT)
Q_PROPERTY(QString deviceId READ getDeviceId CONSTANT)
Q_PROPERTY(bool sender READ getSender CONSTANT)
@@ -203,7 +203,7 @@ private:
mtx::common::RelatesTo relation;
State state_ = PromptStartVerification;
- Error error_;
+ Error error_ = UnknownMethod;
bool isMacVerified = false;
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index 250cd5f0..ed720056 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -396,6 +396,18 @@ TimelineViewManager::verifyUser(QString userid)
tr("No share room with this user found. Create an "
"encrypted room with this user and try again."));
}
+
+void
+TimelineViewManager::removeVerificationFlow(DeviceVerificationFlow *flow)
+{
+ for (auto it = dvList.keyValueBegin(); it != dvList.keyValueEnd(); ++it) {
+ if (it->second == flow) {
+ dvList.remove(it->first);
+ return;
+ }
+ }
+}
+
void
TimelineViewManager::verifyDevice(QString userid, QString deviceid)
{
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 12e49080..a8bd2e06 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -62,6 +62,7 @@ public:
Q_INVOKABLE void openMemberListDialog() const;
Q_INVOKABLE void openLeaveRoomDialog() const;
Q_INVOKABLE void openRoomSettings() const;
+ Q_INVOKABLE void removeVerificationFlow(DeviceVerificationFlow *flow);
void verifyUser(QString userid);
void verifyDevice(QString userid, QString deviceid);
|