Add OutgoingMessageRatingPreview()
authorThomas
Fri, 07 Sep 2018 14:22:12 +0200
changeset 2922c8123bded5a
parent 291 9b14d293f6f1
child 293 262897d139e5
Add OutgoingMessageRatingPreview()
CpEpEngine.cpp
CpEpEngine.h
pEpCOMServerAdapter.idl
     1.1 --- a/CpEpEngine.cpp	Mon Aug 20 11:32:32 2018 +0200
     1.2 +++ b/CpEpEngine.cpp	Fri Sep 07 14:22:12 2018 +0200
     1.3 @@ -1113,6 +1113,25 @@
     1.4      return S_OK;
     1.5  }
     1.6  
     1.7 +STDMETHODIMP CpEpEngine::OutgoingMessageRatingPreview(TextMessage *msg, pEpRating * pVal)
     1.8 +{
     1.9 +	assert(msg);
    1.10 +	assert(pVal);
    1.11 +
    1.12 +	if (!(msg  && pVal))
    1.13 +		return E_INVALIDARG;
    1.14 +
    1.15 +	::message *_msg = text_message_to_C(msg);
    1.16 +
    1.17 +	PEP_rating _rating;
    1.18 +	PEP_STATUS status = ::outgoing_message_rating_preview(get_session(), _msg, &_rating);
    1.19 +	if (status != PEP_STATUS_OK)
    1.20 +		return FAIL(L"cannot get message rating", status);
    1.21 +
    1.22 +	*pVal = (pEpRating)_rating;
    1.23 +	return S_OK;
    1.24 +}
    1.25 +
    1.26  STDMETHODIMP CpEpEngine::IdentityRating(struct pEpIdentity *ident, pEpRating * pVal)
    1.27  {
    1.28      ::pEp_identity *_ident;
     2.1 --- a/CpEpEngine.h	Mon Aug 20 11:32:32 2018 +0200
     2.2 +++ b/CpEpEngine.h	Fri Sep 07 14:22:12 2018 +0200
     2.3 @@ -249,7 +249,8 @@
     2.4  
     2.5      STDMETHOD(DecryptMessage)(TextMessage * src, TextMessage * dst, SAFEARRAY ** keylist, pEpDecryptFlags* flags, pEpRating *rating);
     2.6      STDMETHOD(ReEvaluateMessageRating)(TextMessage * msg, SAFEARRAY * x_KeyList, pEpRating x_EncStatus, pEpRating *rating);
     2.7 -    STDMETHOD(OutgoingMessageRating)(TextMessage *msg, pEpRating * pVal);
     2.8 +	STDMETHOD(OutgoingMessageRating)(TextMessage *msg, pEpRating * pVal);
     2.9 +	STDMETHOD(OutgoingMessageRatingPreview)(TextMessage *msg, pEpRating * pVal);
    2.10      STDMETHOD(IdentityRating)(pEpIdentity * ident, pEpRating * pVal);
    2.11      STDMETHOD(ColorFromRating)(pEpRating rating, pEpColor * pVal);
    2.12  
     3.1 --- a/pEpCOMServerAdapter.idl	Mon Aug 20 11:32:32 2018 +0200
     3.2 +++ b/pEpCOMServerAdapter.idl	Fri Sep 07 14:22:12 2018 +0200
     3.3 @@ -437,6 +437,9 @@
     3.4  
     3.5      // Trigger an immediate update check.
     3.6      [id(40)] HRESULT UpdateNow();
     3.7 +
     3.8 +	// Get a preview of the outgoint message rating
     3.9 +	[id(41)] HRESULT OutgoingMessageRatingPreview([in] struct TextMessage *msg, [out, retval] pEpRating * pVal);
    3.10  };
    3.11  
    3.12  [