/* * Created by victoria on 2021-05-12. */ #pragma once #include "device_service.h" #include "qomemo.h" #include "variant/omemo_base.h" #include namespace Signal { class Context; } namespace QXmpp::Omemo { class Manager : public QXmppClientExtension { Q_OBJECT; public: Manager(); ~Manager() override = default; bool handleStanza(const QDomElement &stanza) override; bool handleDeviceList(const QDomElement& stanza); bool handleMissingDeviceList(const QDomElement& stanza); QSharedPointer getDeviceService(); Bundle generateAndSaveBundle(int deviceId); public slots: void fetchOwnDevices(); void publishDeviceList(const QXmpp::Omemo::DeviceList& deviceList); void generateDeviceListForSelf(); void generateDeviceForSelfIfNeeded(const QXmpp::Omemo::DeviceList ¤tList); void publishBundle(int deviceId, const QXmpp::Omemo::Bundle& bundle); signals: void deviceListReceived(const QString &jid, const QXmpp::Omemo::DeviceList &list); void deviceListNotFound(const QString &jid); protected: void setClient(QXmppClient *client) override; private: QSharedPointer deviceService; QScopedPointer omemoVariant; QScopedPointer signalContext; }; } // namespace QXmpp::Omemo