diff --git a/src/sync_mixin.cc b/src/sync_mixin.cc new file mode 100644 index 0000000..051d541 --- /dev/null +++ b/src/sync_mixin.cc @@ -0,0 +1,30 @@ +#include "sync_mixin.hh" +#include +#include + +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; + } + } +} + diff --git a/src/sync_mixin.hh b/src/sync_mixin.hh new file mode 100644 index 0000000..ae3b865 --- /dev/null +++ b/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); + }; + } +} +