CpEpEngine.cpp
branchENGINE-320 COM-72
changeset 265 d13ae58b6862
parent 264 aa6bd84bd6c3
     1.1 --- a/CpEpEngine.cpp	Fri Dec 01 19:38:09 2017 +0100
     1.2 +++ b/CpEpEngine.cpp	Sun Dec 17 11:03:41 2017 +0100
     1.3 @@ -257,10 +257,11 @@
     1.4      ::stringlist_t *_keylist = NULL;
     1.5      string _lang;
     1.6      *words = NULL;
     1.7 +	blob_buffers _buffers;
     1.8  
     1.9      try {
    1.10          _received_by = new_identity(receivedBy);
    1.11 -        _msg = text_message_to_C(msg);
    1.12 +        _msg = text_message_to_C(msg, _buffers);
    1.13  
    1.14          if (keylist) {
    1.15              _keylist = new_stringlist(keylist);
    1.16 @@ -837,7 +838,9 @@
    1.17      if (!(src && dst))
    1.18          return E_INVALIDARG;
    1.19  
    1.20 -    ::message *_src = text_message_to_C(src);
    1.21 +	blob_buffers _buffers;
    1.22 +
    1.23 +    ::message *_src = text_message_to_C(src, _buffers);
    1.24  
    1.25      // COM-19: Initialize msg_dst to NULL, or we end up calling
    1.26      // free_message() below with a pointer to random garbage in
    1.27 @@ -891,7 +894,9 @@
    1.28  
    1.29      ::pEp_identity *_target_id = new_identity(targetId);
    1.30  
    1.31 -    ::message *_src = text_message_to_C(src);
    1.32 +	blob_buffers _buffers;
    1.33 +
    1.34 +    ::message *_src = text_message_to_C(src, _buffers);
    1.35  
    1.36      // COM-19: Initialize msg_dst to NULL, or we end up calling
    1.37      // free_message() below with a pointer to random garbage in
    1.38 @@ -933,7 +938,9 @@
    1.39      *keylist = NULL;
    1.40      *rating = pEpRatingUndefined;
    1.41  
    1.42 -    ::message *_src = text_message_to_C(src);
    1.43 +	blob_buffers _buffers;
    1.44 +
    1.45 +    ::message *_src = text_message_to_C(src, _buffers);
    1.46      ::message *msg_dst = NULL;
    1.47      ::stringlist_t *_keylist = NULL;
    1.48      ::PEP_rating _rating;
    1.49 @@ -970,7 +977,9 @@
    1.50  
    1.51      *rating = pEpRatingUndefined;
    1.52  
    1.53 -    ::message *_msg = text_message_to_C(msg);
    1.54 +	blob_buffers _buffers;
    1.55 +
    1.56 +    ::message *_msg = text_message_to_C(msg, _buffers);
    1.57      ::stringlist_t *_keylist = new_stringlist(x_KeyList);
    1.58      ::PEP_rating _rating = PEP_rating_undefined;
    1.59  
    1.60 @@ -992,10 +1001,14 @@
    1.61      if (!(msg  && pVal))
    1.62          return E_INVALIDARG;
    1.63  
    1.64 -    ::message *_msg = text_message_to_C(msg);
    1.65 +	blob_buffers _buffers;
    1.66 +
    1.67 +    ::message *_msg = text_message_to_C(msg, _buffers);
    1.68  
    1.69      PEP_rating _rating;
    1.70      PEP_STATUS status = ::outgoing_message_rating(get_session(), _msg, &_rating);
    1.71 +
    1.72 +	::free_message(_msg);
    1.73      if (status != PEP_STATUS_OK)
    1.74          return FAIL(L"cannot get message rating", status);
    1.75