summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-01-12 13:32:12 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-01-12 15:00:59 +0100
commit81762119b9285956d5c71ba7262b4ed367ac8e7e (patch)
treef2977f4bc78887a65583ff946f514eb24188dea9 /src
parentUpdate QtQuick versions to match Qt 5.10 (diff)
downloadnheko-81762119b9285956d5c71ba7262b4ed367ac8e7e.tar.xz
Make device verification request dialogs easier to understand.
Diffstat (limited to 'src')
-rw-r--r--src/DeviceVerificationFlow.cpp6
-rw-r--r--src/DeviceVerificationFlow.h7
2 files changed, 13 insertions, 0 deletions
diff --git a/src/DeviceVerificationFlow.cpp b/src/DeviceVerificationFlow.cpp

index f692629e..51ef79fd 100644 --- a/src/DeviceVerificationFlow.cpp +++ b/src/DeviceVerificationFlow.cpp
@@ -505,6 +505,12 @@ DeviceVerificationFlow::getSasList() return this->sasList; } +bool +DeviceVerificationFlow::isSelfVerification() const +{ + return this->toClient.to_string() == http::client()->user_id().to_string(); +} + void DeviceVerificationFlow::setEventId(std::string event_id_) { diff --git a/src/DeviceVerificationFlow.h b/src/DeviceVerificationFlow.h
index d6e5411e..34b78962 100644 --- a/src/DeviceVerificationFlow.h +++ b/src/DeviceVerificationFlow.h
@@ -63,6 +63,8 @@ class DeviceVerificationFlow : public QObject Q_PROPERTY(QString deviceId READ getDeviceId CONSTANT) Q_PROPERTY(bool sender READ getSender CONSTANT) Q_PROPERTY(std::vector<int> sasList READ getSasList CONSTANT) + Q_PROPERTY(bool isDeviceVerification READ isDeviceVerification CONSTANT) + Q_PROPERTY(bool isSelfVerification READ isSelfVerification CONSTANT) public: enum State @@ -129,6 +131,11 @@ public: // setters void setDeviceId(QString deviceID); void setEventId(std::string event_id); + bool isDeviceVerification() const + { + return this->type == DeviceVerificationFlow::Type::ToDevice; + } + bool isSelfVerification() const; void callback_fn(const UserKeyCache &res, mtx::http::RequestErr err, std::string user_id);