summary refs log tree commit diff
path: root/src/encryption/VerificationManager.h
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2021-11-03 21:43:11 -0400
committerJoseph Donofry <joedonofry@gmail.com>2021-11-03 21:43:11 -0400
commit743a83c8e6f0b64b21e8042a9eb04ce35c713008 (patch)
treef980bdb8c45e607547f87e48f42144227166aa6c /src/encryption/VerificationManager.h
parentMerge remote-tracking branch 'nheko-im/master' into video_player_enhancements (diff)
parentUpdate translations (diff)
downloadnheko-743a83c8e6f0b64b21e8042a9eb04ce35c713008.tar.xz
Update video_player_enhancements with changes from master
Diffstat (limited to 'src/encryption/VerificationManager.h')
-rw-r--r--src/encryption/VerificationManager.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/encryption/VerificationManager.h b/src/encryption/VerificationManager.h
new file mode 100644

index 00000000..da646c2f --- /dev/null +++ b/src/encryption/VerificationManager.h
@@ -0,0 +1,48 @@ +// SPDX-FileCopyrightText: 2021 Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include <QHash> +#include <QObject> +#include <QSharedPointer> + +#include <mtx/events.hpp> +#include <mtx/events/encrypted.hpp> + +class DeviceVerificationFlow; +class TimelineModel; +class TimelineModel; +class TimelineViewManager; +class RoomlistModel; + +class VerificationManager : public QObject +{ + Q_OBJECT + +public: + VerificationManager(TimelineViewManager *o = nullptr); + + Q_INVOKABLE void removeVerificationFlow(DeviceVerificationFlow *flow); + void verifyUser(QString userid); + void verifyDevice(QString userid, QString deviceid); + void verifyOneOfDevices(QString userid, std::vector<QString> deviceids); + +signals: + void newDeviceVerificationRequest(DeviceVerificationFlow *flow); + +public slots: + void receivedRoomDeviceVerificationRequest( + const mtx::events::RoomEvent<mtx::events::msg::KeyVerificationRequest> &message, + TimelineModel *model); + void receivedDeviceVerificationRequest(const mtx::events::msg::KeyVerificationRequest &msg, + std::string sender); + void receivedDeviceVerificationStart(const mtx::events::msg::KeyVerificationStart &msg, + std::string sender); + +private: + QHash<QString, QSharedPointer<DeviceVerificationFlow>> dvList; + bool isInitialSync_ = false; + RoomlistModel *rooms_; +};