forked from blue/squawk
31 lines
801 B
C++
31 lines
801 B
C++
|
/*
|
||
|
* Created by victoria on 2021-05-12.
|
||
|
*/
|
||
|
|
||
|
#include "device_service.h"
|
||
|
|
||
|
#include <QXmppClient.h>
|
||
|
#include <QXmppPubSubIq.h>
|
||
|
|
||
|
#include <QDebug>
|
||
|
|
||
|
QXmpp::Omemo::DeviceService::DeviceService(QXmppClient &client, QObject *parent)
|
||
|
: QObject(parent), client(client) {
|
||
|
connect(&client, &QXmppClient::iqReceived, this,
|
||
|
&DeviceService::onIqReceived);
|
||
|
}
|
||
|
|
||
|
void QXmpp::Omemo::DeviceService::onIqReceived(const QXmppIq &iq) {
|
||
|
// Update OMEMO device list
|
||
|
}
|
||
|
|
||
|
void QXmpp::Omemo::DeviceService::fetch() {
|
||
|
QXmppPubSubIq fetchOwnDevices{};
|
||
|
fetchOwnDevices.setFrom(client.configuration().jid());
|
||
|
fetchOwnDevices.setTo(client.configuration().jidBare());
|
||
|
fetchOwnDevices.setType(QXmppIq::Get);
|
||
|
fetchOwnDevices.setQueryNode("urn:xmpp:omemo:1:devices");
|
||
|
|
||
|
client.sendPacket(fetchOwnDevices);
|
||
|
}
|