
2 changed files with 49 additions and 0 deletions
@ -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; |
|||
} |
|||
} |
|||
} |
|||
|
@ -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…
Reference in new issue