Browse Source

Wrap SetIdentity method

master
Thomas 3 weeks ago
parent
commit
d03da9f2ad
3 changed files with 33 additions and 0 deletions
  1. +29
    -0
      CpEpEngine.cpp
  2. +1
    -0
      CpEpEngine.h
  3. +3
    -0
      pEpCOMServerAdapter.idl

+ 29
- 0
CpEpEngine.cpp View File

@ -2159,4 +2159,33 @@ STDMETHODIMP CpEpEngine::DisableAllSyncChannels()
return E_OUTOFMEMORY;
else
return FAIL(L"DisableAllSyncChannels", status);
}
STDMETHODIMP CpEpEngine::SetIdentity(struct pEpIdentity* identity) {
assert(identity);
if (!identity)
return E_INVALIDARG;
::pEp_identity* _ident = nullptr;
try {
_ident = new_identity(identity);
assert(_ident);
if (_ident == NULL)
return E_OUTOFMEMORY;
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;
}
catch (exception& ex) {
return FAIL(ex.what());;
}
PEP_STATUS status = ::set_identity(session(), _ident);
::free_identity(_ident);
if (status != PEP_STATUS_OK)
return FAIL(_T("SetIdentity"), status);
return S_OK;
}

+ 1
- 0
CpEpEngine.h View File

@ -248,6 +248,7 @@ public:
STDMETHOD(IdentityRating)(pEpIdentity * ident, pEpRating * pVal);
STDMETHOD(ColorFromRating)(pEpRating rating, pEpColor * pVal);
STDMETHOD(RatingFromCommType)(pEpComType commType, pEpRating * rating);
STDMETHOD(SetIdentity)(struct pEpIdentity* identity);
STDMETHOD(EncryptMessageForSelf)(
pEpIdentity * targetId,


+ 3
- 0
pEpCOMServerAdapter.idl View File

@ -550,6 +550,9 @@ interface IpEpEngine : IUnknown {
// Disables sync for all identities
[id(68)] HRESULT DisableAllSyncChannels();
// Sets the identity
[id(69)] HRESULT SetIdentity([in] struct pEpIdentity* identity);
};
[


Loading…
Cancel
Save