You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.2 KiB
55 lines
1.2 KiB
#include "syncthread.h"
|
|
|
|
#include <kde_pep_common/pephelpers.h>
|
|
|
|
#include <QDebug>
|
|
|
|
pEpSyncThread *pEpSyncThread::hackinstance = nullptr;
|
|
|
|
void pEpSyncThread::slotMessageToSend(message *msg)
|
|
{
|
|
}
|
|
|
|
void pEpSyncThread::slotNotifyHandshake(_pEp_identity *, _pEp_identity *, _sync_handshake_signal)
|
|
{
|
|
}
|
|
|
|
PEP_STATUS pEpSyncThread::messageToSend(message *msg)
|
|
{
|
|
if (pEpSyncThread::hackinstance) {
|
|
pEpSyncThread::hackinstance->slotMessageToSend(msg);
|
|
}
|
|
return PEP_STATUS_OK;
|
|
}
|
|
|
|
PEP_STATUS pEpSyncThread::notifyHandshake(_pEp_identity *id1, _pEp_identity *id2, _sync_handshake_signal sig)
|
|
{
|
|
if (pEpSyncThread::hackinstance) {
|
|
pEpSyncThread::hackinstance->slotNotifyHandshake(id1, id2, sig);
|
|
}
|
|
return PEP_STATUS_OK;
|
|
}
|
|
|
|
pEpSyncThread::pEpSyncThread(QObject *parent)
|
|
: QThread(parent)
|
|
{
|
|
hackinstance = this;
|
|
pEp::Adapter::session.initialize(pEp::Adapter::SyncModes::Sync, true, messageToSend, notifyHandshake);
|
|
// pEp::Adapter::session.initialize();
|
|
}
|
|
|
|
pEpSyncThread::~pEpSyncThread()
|
|
{
|
|
mutex.lock();
|
|
pEp::Adapter::session.release();
|
|
mutex.unlock();
|
|
wait();
|
|
}
|
|
|
|
void pEpSyncThread::run()
|
|
{
|
|
mutex.lock();
|
|
pEp::Adapter::start_sync();
|
|
mutex.unlock();
|
|
}
|