switch to pEpIdentityFlags data type
authorVolker Birk <vb@pep-project.org>
Wed, 23 Nov 2016 20:22:17 +0100
changeset 21903531c4d3fda
parent 218 ef80732697e6
child 220 92489901bb81
switch to pEpIdentityFlags data type
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
pEp_utility.cpp
     1.1 --- a/CpEpEngine.cpp	Wed Nov 23 17:04:34 2016 +0100
     1.2 +++ b/CpEpEngine.cpp	Wed Nov 23 20:22:17 2016 +0100
     1.3 @@ -294,8 +294,12 @@
     1.4  	return S_OK;
     1.5  }
     1.6  
     1.7 -STDMETHODIMP CpEpEngine::SetIdentityFlags(struct pEpIdentity *identity, LONG flags)
     1.8 +STDMETHODIMP CpEpEngine::SetIdentityFlags(struct pEpIdentity *identity, pEpIdentityFlags flags)
     1.9  {
    1.10 +	assert(identity);
    1.11 +	if (!identity)
    1.12 +		return E_INVALIDARG;
    1.13 +
    1.14  	::pEp_identity *_ident = nullptr;
    1.15  
    1.16  	try {
    1.17 @@ -319,8 +323,12 @@
    1.18  	return S_OK;
    1.19  }
    1.20  
    1.21 -STDMETHODIMP CpEpEngine::UnsetIdentityFlags(struct pEpIdentity *identity, LONG flags)
    1.22 +STDMETHODIMP CpEpEngine::UnsetIdentityFlags(struct pEpIdentity *identity, pEpIdentityFlags flags)
    1.23  {
    1.24 +	assert(identity);
    1.25 +	if (!identity)
    1.26 +		return E_INVALIDARG;
    1.27 +
    1.28  	::pEp_identity *_ident = nullptr;
    1.29  
    1.30  	try {
    1.31 @@ -897,6 +905,16 @@
    1.32  	return S_OK;
    1.33  }
    1.34  
    1.35 +STDMETHODIMP CpEpEngine::OwnIdentitiesRetrieve(LPSAFEARRAY* own_identities)
    1.36 +{
    1.37 +	assert(own_identities);
    1.38 +	if (!own_identities)
    1.39 +		return E_INVALIDARG;
    1.40 +
    1.41 +
    1.42 +	return S_OK;
    1.43 +}
    1.44 +
    1.45  STDMETHODIMP CpEpEngine::TrustPersonalKey(struct pEpIdentity *ident, struct pEpIdentity *result)
    1.46  {
    1.47  	::pEp_identity *_ident;
     2.1 --- a/CpEpEngine.h	Wed Nov 23 17:04:34 2016 +0100
     2.2 +++ b/CpEpEngine.h	Wed Nov 23 20:22:17 2016 +0100
     2.3 @@ -161,8 +161,8 @@
     2.4      STDMETHOD(GetCrashdumpLog)(LONG maxlines, BSTR * log);
     2.5      STDMETHOD(GetEngineVersion)(BSTR * engineVersion);
     2.6      STDMETHOD(GetLanguageList)(BSTR * languages);
     2.7 -	STDMETHOD(SetIdentityFlags)(struct pEpIdentity *identity, LONG flags);
     2.8 -	STDMETHOD(UnsetIdentityFlags)(struct pEpIdentity *identity, LONG flags);
     2.9 +	STDMETHOD(SetIdentityFlags)(struct pEpIdentity *identity, pEpIdentityFlags flags);
    2.10 +	STDMETHOD(UnsetIdentityFlags)(struct pEpIdentity *identity, pEpIdentityFlags flags);
    2.11  
    2.12      // keymanagement API
    2.13  
    2.14 @@ -174,7 +174,7 @@
    2.15      STDMETHOD(KeyMistrusted)(struct pEpIdentity *ident);
    2.16      STDMETHOD(KeyResetTrust)(struct pEpIdentity *ident);
    2.17      STDMETHOD(TrustPersonalKey)(struct pEpIdentity *ident, struct pEpIdentity *result);
    2.18 -
    2.19 +	STDMETHOD(OwnIdentitiesRetrieve)(LPSAFEARRAY* own_identities);
    2.20  
    2.21      // Blacklist API
    2.22  
     3.1 --- a/pEpCOMServerAdapter.idl	Wed Nov 23 17:04:34 2016 +0100
     3.2 +++ b/pEpCOMServerAdapter.idl	Wed Nov 23 20:22:17 2016 +0100
     3.3 @@ -129,11 +129,11 @@
     3.4          BSTR UserName;
     3.5          pEpComType CommType;
     3.6          BSTR Lang;
     3.7 -		int Flags;
     3.8 +		pEpIdentityFlags Flags;
     3.9      };
    3.10  
    3.11 -	HRESULT SetIdentityFlags([in] struct pEpIdentity *identity, [in] LONG flags);
    3.12 -	HRESULT UnsetIdentityFlags([in] struct pEpIdentity *identity, [in] LONG flags);
    3.13 +	HRESULT SetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
    3.14 +	HRESULT UnsetIdentityFlags([in] struct pEpIdentity *identity, [in] pEpIdentityFlags flags);
    3.15  
    3.16      // Keymanagement API
    3.17  
    3.18 @@ -145,6 +145,7 @@
    3.19      HRESULT KeyMistrusted([in] struct pEpIdentity *ident);
    3.20      HRESULT KeyResetTrust([in] struct pEpIdentity *ident);
    3.21      HRESULT TrustPersonalKey([in] struct pEpIdentity *ident, [out, retval] struct pEpIdentity *result);
    3.22 +	HRESULT OwnIdentitiesRetrieve([out, retval] SAFEARRAY(struct pEpIdentity)* own_identities);
    3.23  
    3.24      // Blacklist API
    3.25  
     4.1 --- a/pEp_utility.cpp	Wed Nov 23 17:04:34 2016 +0100
     4.2 +++ b/pEp_utility.cpp	Wed Nov 23 20:22:17 2016 +0100
     4.3 @@ -79,7 +79,7 @@
     4.4              _ident->Lang = utf16_bstr(this->lang);
     4.5              _ident->UserName = utf16_bstr(this->username);
     4.6              _ident->UserId = utf16_bstr(this->user_id);
     4.7 -			_ident->Flags = this->flags;
     4.8 +			_ident->Flags = (pEpIdentityFlags) this->flags;
     4.9  
    4.10              return _ident;
    4.11          }
    4.12 @@ -103,7 +103,7 @@
    4.13                  ident_s->CommType = (pEpComType) ident->comm_type;
    4.14                  if (ident->lang)
    4.15                      ident_s->Lang = utf16_bstr(ident->lang);
    4.16 -				ident_s->Flags = (int) ident->flags;
    4.17 +				ident_s->Flags = (pEpIdentityFlags) ident->flags;
    4.18              }
    4.19          }
    4.20