ENGINE-179 added ReEvaluateMessageRating ENGINE-179
authorEdouard Tisserant <edouard@pep-project.org>
Wed, 07 Jun 2017 13:49:37 +0200
branchENGINE-179
changeset 2492ac6226ff198
parent 248 e55fc51ec0f9
child 250 9b03d0b58aab
ENGINE-179 added ReEvaluateMessageRating
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Fri Apr 21 17:11:50 2017 +0200
     1.2 +++ b/CpEpEngine.cpp	Wed Jun 07 13:49:37 2017 +0200
     1.3 @@ -944,6 +944,31 @@
     1.4      return S_OK;
     1.5  }
     1.6  
     1.7 +STDMETHODIMP CpEpEngine::ReEvaluateMessageRating(TextMessage * msg, SAFEARRAY * x_keylist, pEpRating x_enc_status, pEpRating *rating)
     1.8 +{
     1.9 +    assert(msg);
    1.10 +    assert(x_keylist);
    1.11 +    assert(x_enc_status != PEP_rating_undefined);
    1.12 +    assert(rating);
    1.13 +
    1.14 +    if (!(msg && x_keylist && x_enc_status != PEP_rating_undefined && rating))
    1.15 +        return E_INVALIDARG;
    1.16 +
    1.17 +    *rating = pEpRatingUndefined;
    1.18 +
    1.19 +    ::message *_msg = text_message_to_C(msg);
    1.20 +    ::stringlist_t *_keylist = new_stringlist(x_keylist);
    1.21 +    ::PEP_rating _rating = PEP_rating_undefined;
    1.22 +
    1.23 +    PEP_STATUS status = ::re_evaluate_message_rating(get_session(), _msg, _keylist, x_enc_status, &_rating);
    1.24 +
    1.25 +    ::free_message(_msg);
    1.26 +
    1.27 +    *rating = (pEpRating)_rating;
    1.28 +
    1.29 +    return S_OK;
    1.30 +}
    1.31 +
    1.32  STDMETHODIMP CpEpEngine::OutgoingMessageRating(TextMessage *msg, pEpRating * pVal)
    1.33  {
    1.34      assert(msg);
     2.1 --- a/CpEpEngine.h	Fri Apr 21 17:11:50 2017 +0200
     2.2 +++ b/CpEpEngine.h	Wed Jun 07 13:49:37 2017 +0200
     2.3 @@ -210,6 +210,7 @@
     2.4  
     2.5      STDMETHOD(EncryptMessage)(TextMessage * src, TextMessage * dst, SAFEARRAY * extra, pEpEncryptFlags flags);
     2.6      STDMETHOD(DecryptMessage)(TextMessage * src, TextMessage * dst, SAFEARRAY ** keylist, pEpDecryptFlags* flags, pEpRating *rating);
     2.7 +    STDMETHOD(ReEvaluateMessageRating)(TextMessage * msg, SAFEARRAY * x_keylist, pEpRating x_enc_status, pEpRating *rating);
     2.8      STDMETHOD(OutgoingMessageRating)(TextMessage *msg, pEpRating * pVal);
     2.9      STDMETHOD(IdentityRating)(pEpIdentity * ident, pEpRating * pVal);
    2.10  	STDMETHOD(ColorFromRating)(pEpRating rating, pEpColor * pVal);
     3.1 --- a/pEpCOMServerAdapter.idl	Fri Apr 21 17:11:50 2017 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Wed Jun 07 13:49:37 2017 +0200
     3.3 @@ -286,6 +286,12 @@
     3.4          [out] pEpDecryptFlags* flags,
     3.5          [out, retval] pEpRating *rating);
     3.6  
     3.7 +    HRESULT ReEvaluateMessageRating(
     3.8 +        [in] struct TextMessage *src,
     3.9 +        [in] SAFEARRAY(BSTR) x_keylist,
    3.10 +        [in] pEpRating x_enc_status,
    3.11 +        [out, retval] pEpRating *rating);
    3.12 +
    3.13      HRESULT OutgoingMessageRating([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
    3.14      HRESULT IdentityRating([in] struct pEpIdentity * ident, [out, retval] pEpRating * pVal);
    3.15      HRESULT ColorFromRating([in] pEpRating rating, [out, retval] pEpColor* pVal);