mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-03 11:49:31 +00:00
Correctly set Content-Disposition header on multipart content.
This commit is contained in:
parent
035503cd53
commit
d0a8b3f15c
1 changed files with 12 additions and 1 deletions
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "linphone/api/c-content.h"
|
||||
|
||||
#include "content-disposition.h"
|
||||
#include "content-manager.h"
|
||||
#include "content-type.h"
|
||||
#include "content/content.h"
|
||||
|
|
@ -47,7 +48,10 @@ list<Content> ContentManager::multipartToContentList (const Content &content) {
|
|||
for (const belle_sip_list_t *parts = sal_body_handler_get_parts(sbh); parts; parts = parts->next) {
|
||||
SalBodyHandler *part = (SalBodyHandler *)parts->data;
|
||||
LinphoneContent *cContent = linphone_content_from_sal_body_handler(part);
|
||||
contents.push_back(*L_GET_CPP_PTR_FROM_C_OBJECT(cContent));
|
||||
Content *cppContent = L_GET_CPP_PTR_FROM_C_OBJECT(cContent);
|
||||
if (content.getContentDisposition().isValid())
|
||||
cppContent->setContentDisposition(content.getContentDisposition());
|
||||
contents.push_back(*cppContent);
|
||||
linphone_content_unref(cContent);
|
||||
}
|
||||
|
||||
|
|
@ -61,7 +65,12 @@ Content ContentManager::contentListToMultipart (const list<Content *> &contents)
|
|||
);
|
||||
mpbh = (belle_sip_multipart_body_handler_t *)belle_sip_object_ref(mpbh);
|
||||
|
||||
ContentDisposition disposition;
|
||||
for (Content *content : contents) {
|
||||
// Is this content-disposition stuff generic or only valid for notification content-disposition?
|
||||
if (content->getContentDisposition().isValid())
|
||||
disposition = content->getContentDisposition();
|
||||
|
||||
LinphoneContent *cContent = L_GET_C_BACK_PTR(content);
|
||||
SalBodyHandler *sbh = sal_body_handler_from_content(cContent);
|
||||
belle_sip_multipart_body_handler_add_part(mpbh, BELLE_SIP_BODY_HANDLER(sbh));
|
||||
|
|
@ -76,6 +85,8 @@ Content ContentManager::contentListToMultipart (const list<Content *> &contents)
|
|||
belle_sip_object_unref(mpbh);
|
||||
|
||||
Content content = *L_GET_CPP_PTR_FROM_C_OBJECT(cContent);
|
||||
if (disposition.isValid())
|
||||
content.setContentDisposition(disposition);
|
||||
linphone_content_unref(cContent);
|
||||
return content;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue