Browse Source

Expose enable_identity_for_sync() and disable_identity_for_sync() to app.

COM-121
Thomas 3 years ago
parent
commit
c894cc28d9
3 changed files with 76 additions and 0 deletions
  1. +68
    -0
      CpEpEngine.cpp
  2. +2
    -0
      CpEpEngine.h
  3. +6
    -0
      pEpCOMServerAdapter.idl

+ 68
- 0
CpEpEngine.cpp View File

@ -1793,3 +1793,71 @@ STDMETHODIMP CpEpEngine::PERToXERSyncMessage(TextMessage *msg, BSTR * xer)
return S_OK;
}
STDMETHODIMP CpEpEngine::DisableIdentityForSync(struct pEpIdentity * ident)
{
assert(ident);
if (!ident)
return E_INVALIDARG;
::pEp_identity *_ident;
try {
_ident = new_identity(ident);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception& ex) {
return FAIL(ex.what());
}
assert(_ident);
if (_ident == NULL)
return E_OUTOFMEMORY;
PEP_STATUS status = ::disable_identity_for_sync(session(), _ident);
::free_identity(_ident);
if (status == PEP_STATUS_OK)
return S_OK;
else if (status == PEP_OUT_OF_MEMORY)
return E_OUTOFMEMORY;
else
return FAIL(L"DisableIdentityForSync", status);
}
STDMETHODIMP CpEpEngine::EnableIdentityForSync(struct pEpIdentity * ident)
{
assert(ident);
if (!ident)
return E_INVALIDARG;
::pEp_identity *_ident;
try {
_ident = new_identity(ident);
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception& ex) {
return FAIL(ex.what());
}
assert(_ident);
if (_ident == NULL)
return E_OUTOFMEMORY;
PEP_STATUS status = ::enable_identity_for_sync(session(), _ident);
::free_identity(_ident);
if (status == PEP_STATUS_OK)
return S_OK;
else if (status == PEP_OUT_OF_MEMORY)
return E_OUTOFMEMORY;
else
return FAIL(L"EnableIdentityForSync", status);
}

+ 2
- 0
CpEpEngine.h View File

@ -281,6 +281,8 @@ public:
// sync API
STDMETHOD(DeliverHandshakeResult)(enum SyncHandshakeResult result, SAFEARRAY *identities_sharing);
STDMETHOD(LeaveDeviceGroup)();
STDMETHOD(DisableIdentityForSync)(struct pEpIdentity * ident);
STDMETHOD(EnableIdentityForSync)(struct pEpIdentity * ident);
STDMETHOD(PERToXERSyncMessage)(TextMessage *msg, BSTR * xer);
};


+ 6
- 0
pEpCOMServerAdapter.idl View File

@ -500,6 +500,12 @@ interface IpEpEngine : IUnknown {
// Decode a Sync message from PER into XER
[id(54)] HRESULT PERToXERSyncMessage([in] struct TextMessage *msg, [out, retval] BSTR *xer);
// Disable Sync for this identity
[id(55)] HRESULT DisableIdentityForSync([in] struct pEpIdentity * ident);
// Enable Sync for this identity
[id(56)] HRESULT EnableIdentityForSync([in] struct pEpIdentity * ident);
};
[


Loading…
Cancel
Save