Commit 7148e56f authored by Ronan's avatar Ronan

fix(content-manager): set correctly multi part content

parent 9d5d9ffc
......@@ -68,8 +68,6 @@ list<Content> ContentManager::multipartToContentList (const Content &content) {
}
Content ContentManager::contentListToMultipart (const list<Content> &contents) {
string sub;
belle_sip_memory_body_handler_t *mbh = nullptr;
belle_sip_multipart_body_handler_t *mpbh = belle_sip_multipart_body_handler_new(
nullptr, nullptr, nullptr, MULTIPART_BOUNDARY
......@@ -79,8 +77,7 @@ Content ContentManager::contentListToMultipart (const list<Content> &contents) {
for (const auto &content : contents) {
const ContentType &contentType = content.getContentType();
stringstream subtype;
sub = contentType.getSubType();
subtype << sub << "; charset=\"UTF-8\"";
subtype << contentType.getSubType() << "; charset=\"UTF-8\"";
belle_sip_header_t *cContentType = BELLE_SIP_HEADER(
belle_sip_header_content_type_create(
contentType.getType().c_str(),
......@@ -99,7 +96,7 @@ Content ContentManager::contentListToMultipart (const list<Content> &contents) {
Content content;
content.setBody(desc);
content.setContentType(ContentType("application", sub));
content.setContentType(ContentType::Multipart);
belle_sip_free(desc);
belle_sip_object_unref(mpbh);
......
......@@ -39,15 +39,16 @@ public:
// -----------------------------------------------------------------------------
const ContentType ContentType::ConferenceInfo("application/conference-info+xml");
const ContentType ContentType::Cpim("message/cpim");
const ContentType ContentType::ExternalBody("message/external-body");
const ContentType ContentType::FileTransfer("application/vnd.gsma.rcs-ft-http+xml");
const ContentType ContentType::Imdn("message/imdn+xml");
const ContentType ContentType::ImIsComposing("application/im-iscomposing+xml");
const ContentType ContentType::Multipart("multipart/mixed");
const ContentType ContentType::PlainText("text/plain");
const ContentType ContentType::ResourceLists("application/resource-lists+xml");
const ContentType ContentType::Sdp("application/sdp");
const ContentType ContentType::ConferenceInfo("application/conference-info+xml");
// -----------------------------------------------------------------------------
......
......@@ -61,15 +61,16 @@ public:
static bool isFile (const ContentType &contentType);
static const ContentType ConferenceInfo;
static const ContentType Cpim;
static const ContentType ExternalBody;
static const ContentType FileTransfer;
static const ContentType Imdn;
static const ContentType ImIsComposing;
static const ContentType Multipart;
static const ContentType PlainText;
static const ContentType ResourceLists;
static const ContentType Sdp;
static const ContentType ConferenceInfo;
private:
L_DECLARE_PRIVATE(ContentType);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment