Browse Source

sync mixin

PYADPT-55
Volker Birk 9 years ago
parent
commit
c73ee0f08d
  1. 30
      src/sync_mixin.cc
  2. 19
      src/sync_mixin.hh

30
src/sync_mixin.cc

@ -0,0 +1,30 @@
#include "sync_mixin.hh"
#include <pEp/sync.h>
#include <assert.h>
namespace pEp {
namespace PythonAdapter {
void SyncMixIn::register_for_keysync()
{
PEP_STATUS status = register_sync_callbacks(session, (void *) this,
messageToSend, showHandshake);
assert(status == PEP_STATUS_OK);
}
PEP_STATUS SyncMixIn::messageToSend(void *obj, const message *msg)
{
SyncMixIn *that = (SyncMixIn *) obj;
return PEP_STATUS_OK;
}
PEP_STATUS SyncMixIn::showHandshake(void *obj,
const pEp_identity *self, const pEp_identity *partner)
{
SyncMixIn *that = (SyncMixIn *) obj;
return PEP_STATUS_OK;
}
}
}

19
src/sync_mixin.hh

@ -0,0 +1,19 @@
#pragma once
#include "pEpmodule.hh"
namespace pEp {
namespace PythonAdapter {
class SyncMixIn {
public:
virtual ~SyncMixIn() { }
void register_for_keysync();
protected:
static PEP_STATUS messageToSend(void *obj, const message *msg);
static PEP_STATUS showHandshake(void *obj,
const pEp_identity *self, const pEp_identity *partner);
};
}
}
Loading…
Cancel
Save