Browse Source

fix Wrapper<::message*>::_new() to use mime_decode_message() instead of a dummy.

master
roker 9 months ago
parent
commit
5c399ab820
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      src/types.cc

+ 12
- 4
src/types.cc View File

@ -1,6 +1,9 @@
#include "types.hh"
#include <pEp/status_to_string.hh> // from libpEpAdapter
#include <pEp/mime.h>
/*
#include <pEp/pEpEngine.h>
#include <pEp/stringpair.h>
@ -23,13 +26,18 @@ namespace pEp
template<>
template<>
message* Wrapper<::message*>::_new<PEP_msg_direction, const char*>(PEP_msg_direction dir, const char* s)
message* Wrapper<::message*>::_new<PEP_msg_direction, const char*>(PEP_msg_direction dir, const char* src)
{
message* m = new_message(dir);
if(!m)
message* m = nullptr;
bool pep_msg = false;
PEP_STATUS status = mime_decode_message(src, strlen(src), &m, &pep_msg);
if(status != PEP_STATUS_OK)
{
throw EngineError(PEP_OUT_OF_MEMORY, "new_message()");
throw EngineError(status, "mime_decode_message()");
}
m->dir = dir;
return m;
}


Loading…
Cancel
Save