squawk/qomemo/device_service.h

39 lines
782 B
C
Raw Permalink Normal View History

/*
* Created by victoria on 2021-05-12.
*/
#pragma once
2021-07-22 17:45:39 +00:00
#include <QBuffer>
#include "qomemo.h"
#include "user_device_list.h"
2021-07-22 17:45:39 +00:00
#include "database.h"
#include <QXmppClient.h>
namespace QXmpp::Omemo {
2021-05-13 14:54:37 +00:00
class DeviceList;
2021-05-12 21:32:13 +00:00
2021-05-13 14:54:37 +00:00
class DeviceService : public QObject {
Q_OBJECT
2021-05-13 14:54:37 +00:00
public:
explicit DeviceService(QObject *parent);
2021-07-22 17:45:39 +00:00
QSharedPointer<Database> getDatabase(const QString& jid);
2021-05-13 14:54:37 +00:00
public slots:
2021-07-22 17:45:39 +00:00
void addIdentity(const QString& jid, int deviceId, const QByteArray& publicKey);
2021-05-13 14:54:37 +00:00
void onDeviceListReceived(const QString &jid, const QXmpp::Omemo::DeviceList &list);
2021-07-22 17:45:39 +00:00
void onDeviceListNotFound(const QString &jid);
2021-05-13 14:54:37 +00:00
private:
2021-07-22 17:45:39 +00:00
QMap<QString, QSharedPointer<Database>> databases{};
2021-05-13 14:54:37 +00:00
};
} // namespace QXmpp::Omemo