mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 23:28:09 +00:00
fix(c-content): use tabs instead spaces
This commit is contained in:
parent
ac2eccd78b
commit
c65fea2420
1 changed files with 149 additions and 149 deletions
|
|
@ -37,12 +37,12 @@ using namespace std;
|
|||
L_DECLARE_C_CLONABLE_OBJECT_IMPL(Content,
|
||||
void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */
|
||||
mutable char *name;
|
||||
mutable char *type;
|
||||
mutable char *subtype;
|
||||
mutable char *body;
|
||||
mutable size_t size;
|
||||
mutable char *encoding;
|
||||
mutable char *key;
|
||||
mutable char *type;
|
||||
mutable char *subtype;
|
||||
mutable char *body;
|
||||
mutable size_t size;
|
||||
mutable char *encoding;
|
||||
mutable char *key;
|
||||
)
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -50,82 +50,82 @@ L_DECLARE_C_CLONABLE_OBJECT_IMPL(Content,
|
|||
// =============================================================================
|
||||
|
||||
LinphoneContent * linphone_content_ref(LinphoneContent *content) {
|
||||
belle_sip_object_ref(content);
|
||||
belle_sip_object_ref(content);
|
||||
return content;
|
||||
}
|
||||
|
||||
void linphone_content_unref(LinphoneContent *content) {
|
||||
belle_sip_object_unref(content);
|
||||
belle_sip_object_unref(content);
|
||||
}
|
||||
|
||||
void *linphone_content_get_user_data(const LinphoneContent *content) {
|
||||
return L_GET_USER_DATA_FROM_C_OBJECT(content);
|
||||
return L_GET_USER_DATA_FROM_C_OBJECT(content);
|
||||
}
|
||||
|
||||
void linphone_content_set_user_data(LinphoneContent *content, void *ud) {
|
||||
return L_SET_USER_DATA_FROM_C_OBJECT(content, ud);
|
||||
return L_SET_USER_DATA_FROM_C_OBJECT(content, ud);
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
const char * linphone_content_get_type(const LinphoneContent *content) {
|
||||
if (content->type) ms_free(content->type);
|
||||
content->type = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getType()));
|
||||
return content->type;
|
||||
if (content->type) ms_free(content->type);
|
||||
content->type = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getType()));
|
||||
return content->type;
|
||||
}
|
||||
|
||||
void linphone_content_set_type(LinphoneContent *content, const char *type) {
|
||||
LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
ct.setType(L_C_TO_STRING(type));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct);
|
||||
LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
ct.setType(L_C_TO_STRING(type));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_subtype(const LinphoneContent *content) {
|
||||
if (content->subtype) ms_free(content->subtype);
|
||||
content->subtype = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getSubType()));
|
||||
return content->subtype;
|
||||
if (content->subtype) ms_free(content->subtype);
|
||||
content->subtype = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getSubType()));
|
||||
return content->subtype;
|
||||
}
|
||||
|
||||
void linphone_content_set_subtype(LinphoneContent *content, const char *subtype) {
|
||||
LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
ct.setSubType(L_C_TO_STRING(subtype));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct);
|
||||
LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
ct.setSubType(L_C_TO_STRING(subtype));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct);
|
||||
}
|
||||
|
||||
void linphone_content_add_content_type_parameter(LinphoneContent *content, const char *name, const char *value) {
|
||||
LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
ct.addParameter(L_C_TO_STRING(name), L_C_TO_STRING(value));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct);
|
||||
LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
ct.addParameter(L_C_TO_STRING(name), L_C_TO_STRING(value));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct);
|
||||
}
|
||||
|
||||
uint8_t * linphone_content_get_buffer(const LinphoneContent *content) {
|
||||
return (uint8_t *)linphone_content_get_string_buffer(content);
|
||||
return (uint8_t *)linphone_content_get_string_buffer(content);
|
||||
}
|
||||
|
||||
void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) {
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBody(buffer, size);
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBody(buffer, size);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_string_buffer(const LinphoneContent *content) {
|
||||
if (content->body) ms_free(content->body);
|
||||
content->body = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str());
|
||||
return content->body;
|
||||
if (content->body) ms_free(content->body);
|
||||
content->body = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str());
|
||||
return content->body;
|
||||
}
|
||||
|
||||
void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) {
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBodyFromUtf8(L_C_TO_STRING(buffer));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBodyFromUtf8(L_C_TO_STRING(buffer));
|
||||
}
|
||||
|
||||
size_t linphone_content_get_size(const LinphoneContent *content) {
|
||||
size_t size = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getSize();
|
||||
if (size == 0) {
|
||||
size = content->size;
|
||||
}
|
||||
return size;
|
||||
size_t size = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getSize();
|
||||
if (size == 0) {
|
||||
size = content->size;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
void linphone_content_set_size(LinphoneContent *content, size_t size) {
|
||||
content->size = size;
|
||||
content->size = size;
|
||||
}
|
||||
|
||||
const char * linphone_content_get_encoding(const LinphoneContent *content) {
|
||||
|
|
@ -133,103 +133,103 @@ const char * linphone_content_get_encoding(const LinphoneContent *content) {
|
|||
}
|
||||
|
||||
void linphone_content_set_encoding(LinphoneContent *content, const char *encoding) {
|
||||
if (content->encoding) ms_free(content->encoding);
|
||||
content->encoding = ms_strdup(encoding);
|
||||
if (content->encoding) ms_free(content->encoding);
|
||||
content->encoding = ms_strdup(encoding);
|
||||
}
|
||||
|
||||
const char * linphone_content_get_name(const LinphoneContent *content) {
|
||||
const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFile()) {
|
||||
const LinphonePrivate::FileContent *fc = static_cast<const LinphonePrivate::FileContent *>(c);
|
||||
if (content->name) ms_free(content->name);
|
||||
content->name = ms_strdup(L_STRING_TO_C(fc->getFileName()));
|
||||
} else if (c->isFileTransfer()) {
|
||||
const LinphonePrivate::FileTransferContent *ftc = static_cast<const LinphonePrivate::FileTransferContent *>(c);
|
||||
if (content->name) ms_free(content->name);
|
||||
content->name = ms_strdup(L_STRING_TO_C(ftc->getFileName()));
|
||||
}
|
||||
return content->name;
|
||||
const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFile()) {
|
||||
const LinphonePrivate::FileContent *fc = static_cast<const LinphonePrivate::FileContent *>(c);
|
||||
if (content->name) ms_free(content->name);
|
||||
content->name = ms_strdup(L_STRING_TO_C(fc->getFileName()));
|
||||
} else if (c->isFileTransfer()) {
|
||||
const LinphonePrivate::FileTransferContent *ftc = static_cast<const LinphonePrivate::FileTransferContent *>(c);
|
||||
if (content->name) ms_free(content->name);
|
||||
content->name = ms_strdup(L_STRING_TO_C(ftc->getFileName()));
|
||||
}
|
||||
return content->name;
|
||||
}
|
||||
|
||||
void linphone_content_set_name(LinphoneContent *content, const char *name) {
|
||||
if (content->name) ms_free(content->name);
|
||||
if (content->name) ms_free(content->name);
|
||||
|
||||
LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFile()) {
|
||||
LinphonePrivate::FileContent *fc = static_cast<LinphonePrivate::FileContent *>(c);
|
||||
fc->setFileName(L_C_TO_STRING(name));
|
||||
} else if (c->isFileTransfer()) {
|
||||
LinphonePrivate::FileTransferContent *ftc = static_cast<LinphonePrivate::FileTransferContent *>(c);
|
||||
ftc->setFileName(L_C_TO_STRING(name));
|
||||
}
|
||||
LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFile()) {
|
||||
LinphonePrivate::FileContent *fc = static_cast<LinphonePrivate::FileContent *>(c);
|
||||
fc->setFileName(L_C_TO_STRING(name));
|
||||
} else if (c->isFileTransfer()) {
|
||||
LinphonePrivate::FileTransferContent *ftc = static_cast<LinphonePrivate::FileTransferContent *>(c);
|
||||
ftc->setFileName(L_C_TO_STRING(name));
|
||||
}
|
||||
|
||||
content->name = ms_strdup(name);
|
||||
content->name = ms_strdup(name);
|
||||
}
|
||||
|
||||
bool_t linphone_content_is_multipart(const LinphoneContent *content) {
|
||||
return L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().isMultipart();
|
||||
return L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().isMultipart();
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx) {
|
||||
SalBodyHandler *part_body_handler;
|
||||
SalBodyHandler *body_handler = sal_body_handler_from_content(content);
|
||||
if (!sal_body_handler_is_multipart(body_handler)) {
|
||||
sal_body_handler_unref(body_handler);
|
||||
return NULL;
|
||||
}
|
||||
if (!sal_body_handler_is_multipart(body_handler)) {
|
||||
sal_body_handler_unref(body_handler);
|
||||
return NULL;
|
||||
}
|
||||
part_body_handler = sal_body_handler_get_part(body_handler, idx);
|
||||
LinphoneContent *result = linphone_content_from_sal_body_handler(part_body_handler);
|
||||
sal_body_handler_unref(body_handler);
|
||||
return result;
|
||||
sal_body_handler_unref(body_handler);
|
||||
return result;
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value) {
|
||||
SalBodyHandler *part_body_handler;
|
||||
SalBodyHandler *body_handler = sal_body_handler_from_content(content);
|
||||
if (!sal_body_handler_is_multipart(body_handler)) {
|
||||
sal_body_handler_unref(body_handler);
|
||||
return NULL;
|
||||
}
|
||||
if (!sal_body_handler_is_multipart(body_handler)) {
|
||||
sal_body_handler_unref(body_handler);
|
||||
return NULL;
|
||||
}
|
||||
part_body_handler = sal_body_handler_find_part_by_header(body_handler, header_name, header_value);
|
||||
LinphoneContent *result = linphone_content_from_sal_body_handler(part_body_handler);
|
||||
sal_body_handler_unref(body_handler);
|
||||
return result;
|
||||
LinphoneContent *result = linphone_content_from_sal_body_handler(part_body_handler);
|
||||
sal_body_handler_unref(body_handler);
|
||||
return result;
|
||||
}
|
||||
|
||||
const char * linphone_content_get_custom_header(const LinphoneContent *content, const char *header_name) {
|
||||
SalBodyHandler *body_handler = sal_body_handler_from_content(content);
|
||||
const char *header = sal_body_handler_get_header(body_handler, header_name);
|
||||
sal_body_handler_unref(body_handler);
|
||||
return header;
|
||||
SalBodyHandler *body_handler = sal_body_handler_from_content(content);
|
||||
const char *header = sal_body_handler_get_header(body_handler, header_name);
|
||||
sal_body_handler_unref(body_handler);
|
||||
return header;
|
||||
}
|
||||
|
||||
const char *linphone_content_get_key(const LinphoneContent *content) {
|
||||
if (content->key) ms_free(content->key);
|
||||
if (content->key) ms_free(content->key);
|
||||
|
||||
const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFileTransfer()) {
|
||||
const LinphonePrivate::FileTransferContent *ftc = static_cast<const LinphonePrivate::FileTransferContent *>(c);
|
||||
content->key = ms_strdup(ftc->getFileKeyAsString());
|
||||
}
|
||||
|
||||
return content->key;
|
||||
const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFileTransfer()) {
|
||||
const LinphonePrivate::FileTransferContent *ftc = static_cast<const LinphonePrivate::FileTransferContent *>(c);
|
||||
content->key = ms_strdup(ftc->getFileKeyAsString());
|
||||
}
|
||||
|
||||
return content->key;
|
||||
}
|
||||
|
||||
size_t linphone_content_get_key_size(const LinphoneContent *content) {
|
||||
const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFileTransfer()) {
|
||||
const LinphonePrivate::FileTransferContent *ftc = static_cast<const LinphonePrivate::FileTransferContent *>(c);
|
||||
return ftc->getFileKeySize();
|
||||
}
|
||||
return 0;
|
||||
const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFileTransfer()) {
|
||||
const LinphonePrivate::FileTransferContent *ftc = static_cast<const LinphonePrivate::FileTransferContent *>(c);
|
||||
return ftc->getFileKeySize();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void linphone_content_set_key(LinphoneContent *content, const char *key, const size_t keyLength) {
|
||||
LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFileTransfer()) {
|
||||
LinphonePrivate::FileTransferContent *ftc = static_cast<LinphonePrivate::FileTransferContent *>(c);
|
||||
ftc->setFileKey(key, keyLength);
|
||||
}
|
||||
LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content);
|
||||
if (c->isFileTransfer()) {
|
||||
LinphonePrivate::FileTransferContent *ftc = static_cast<LinphonePrivate::FileTransferContent *>(c);
|
||||
ftc->setFileKey(key, keyLength);
|
||||
}
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -238,39 +238,39 @@ void linphone_content_set_key(LinphoneContent *content, const char *key, const s
|
|||
|
||||
static LinphoneContent * linphone_content_new_with_body_handler(SalBodyHandler *body_handler) {
|
||||
LinphoneContent *content = L_INIT(Content);
|
||||
content->cryptoContext = NULL;
|
||||
LinphonePrivate::Content *c = new LinphonePrivate::Content();
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(content, c);
|
||||
content->cryptoContext = NULL;
|
||||
LinphonePrivate::Content *c = new LinphonePrivate::Content();
|
||||
L_SET_CPP_PTR_FROM_C_OBJECT(content, c);
|
||||
|
||||
if (body_handler != NULL) {
|
||||
linphone_content_set_type(content, sal_body_handler_get_type(body_handler));
|
||||
linphone_content_set_subtype(content, sal_body_handler_get_subtype(body_handler));
|
||||
for (const belle_sip_list_t *params = sal_body_handler_get_content_type_parameters_names(body_handler); params; params = params->next) {
|
||||
const char *paramName = (const char *)(params->data);
|
||||
const char *paramValue = sal_body_handler_get_content_type_parameter(body_handler, paramName);
|
||||
linphone_content_add_content_type_parameter(content, paramName, paramValue);
|
||||
}
|
||||
if (body_handler != NULL) {
|
||||
linphone_content_set_type(content, sal_body_handler_get_type(body_handler));
|
||||
linphone_content_set_subtype(content, sal_body_handler_get_subtype(body_handler));
|
||||
for (const belle_sip_list_t *params = sal_body_handler_get_content_type_parameters_names(body_handler); params; params = params->next) {
|
||||
const char *paramName = (const char *)(params->data);
|
||||
const char *paramValue = sal_body_handler_get_content_type_parameter(body_handler, paramName);
|
||||
linphone_content_add_content_type_parameter(content, paramName, paramValue);
|
||||
}
|
||||
|
||||
if (!linphone_content_is_multipart(content)) {
|
||||
linphone_content_set_string_buffer(content, (char *)sal_body_handler_get_data(body_handler));
|
||||
} else {
|
||||
belle_sip_multipart_body_handler_t *mpbh = BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler);
|
||||
char *body = belle_sip_object_to_string(mpbh);
|
||||
linphone_content_set_string_buffer(content, body);
|
||||
belle_sip_free(body);
|
||||
}
|
||||
|
||||
belle_sip_list_t *headers = (belle_sip_list_t *)sal_body_handler_get_headers(body_handler);
|
||||
while (headers) {
|
||||
belle_sip_header_t *cHeader = BELLE_SIP_HEADER(headers->data);
|
||||
LinphonePrivate::Header header = LinphonePrivate::Header(belle_sip_header_get_name(cHeader), belle_sip_header_get_unparsed_value(cHeader));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->addHeader(header);
|
||||
headers = headers->next;
|
||||
}
|
||||
if (sal_body_handler_get_encoding(body_handler)) linphone_content_set_encoding(content, sal_body_handler_get_encoding(body_handler));
|
||||
if (!linphone_content_is_multipart(content)) {
|
||||
linphone_content_set_string_buffer(content, (char *)sal_body_handler_get_data(body_handler));
|
||||
} else {
|
||||
belle_sip_multipart_body_handler_t *mpbh = BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler);
|
||||
char *body = belle_sip_object_to_string(mpbh);
|
||||
linphone_content_set_string_buffer(content, body);
|
||||
belle_sip_free(body);
|
||||
}
|
||||
|
||||
belle_sip_list_t *headers = (belle_sip_list_t *)sal_body_handler_get_headers(body_handler);
|
||||
while (headers) {
|
||||
belle_sip_header_t *cHeader = BELLE_SIP_HEADER(headers->data);
|
||||
LinphonePrivate::Header header = LinphonePrivate::Header(belle_sip_header_get_name(cHeader), belle_sip_header_get_unparsed_value(cHeader));
|
||||
L_GET_CPP_PTR_FROM_C_OBJECT(content)->addHeader(header);
|
||||
headers = headers->next;
|
||||
}
|
||||
if (sal_body_handler_get_encoding(body_handler)) linphone_content_set_encoding(content, sal_body_handler_get_encoding(body_handler));
|
||||
}
|
||||
|
||||
return content;
|
||||
return content;
|
||||
}
|
||||
|
||||
LinphoneContent * linphone_content_new(void) {
|
||||
|
|
@ -300,32 +300,32 @@ LinphoneContent * linphone_content_from_sal_body_handler(SalBodyHandler *body_ha
|
|||
SalBodyHandler * sal_body_handler_from_content(const LinphoneContent *content) {
|
||||
if (content == NULL) return NULL;
|
||||
|
||||
SalBodyHandler *body_handler;
|
||||
LinphonePrivate::ContentType contentType = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
SalBodyHandler *body_handler;
|
||||
LinphonePrivate::ContentType contentType = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
|
||||
|
||||
if (contentType.isMultipart()) {
|
||||
size_t size = linphone_content_get_size(content);
|
||||
char *buffer = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str());
|
||||
const char *boundary = L_STRING_TO_C(contentType.getParameter("boundary").getValue());
|
||||
belle_sip_multipart_body_handler_t *bh = belle_sip_multipart_body_handler_new_from_buffer(buffer, size, boundary);
|
||||
body_handler = (SalBodyHandler *)BELLE_SIP_BODY_HANDLER(bh);
|
||||
} else {
|
||||
body_handler = sal_body_handler_new();
|
||||
sal_body_handler_set_data(body_handler, belle_sip_strdup(linphone_content_get_string_buffer(content)));
|
||||
}
|
||||
if (contentType.isMultipart()) {
|
||||
size_t size = linphone_content_get_size(content);
|
||||
char *buffer = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str());
|
||||
const char *boundary = L_STRING_TO_C(contentType.getParameter("boundary").getValue());
|
||||
belle_sip_multipart_body_handler_t *bh = belle_sip_multipart_body_handler_new_from_buffer(buffer, size, boundary);
|
||||
body_handler = (SalBodyHandler *)BELLE_SIP_BODY_HANDLER(bh);
|
||||
} else {
|
||||
body_handler = sal_body_handler_new();
|
||||
sal_body_handler_set_data(body_handler, belle_sip_strdup(linphone_content_get_string_buffer(content)));
|
||||
}
|
||||
|
||||
for (const auto &header : L_GET_CPP_PTR_FROM_C_OBJECT(content)->getHeaders()) {
|
||||
belle_sip_header_t *additionalHeader = belle_sip_header_parse(header.asString().c_str());
|
||||
belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(body_handler), additionalHeader);
|
||||
}
|
||||
for (const auto &header : L_GET_CPP_PTR_FROM_C_OBJECT(content)->getHeaders()) {
|
||||
belle_sip_header_t *additionalHeader = belle_sip_header_parse(header.asString().c_str());
|
||||
belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(body_handler), additionalHeader);
|
||||
}
|
||||
|
||||
sal_body_handler_set_type(body_handler, contentType.getType().c_str());
|
||||
sal_body_handler_set_subtype(body_handler, contentType.getSubType().c_str());
|
||||
sal_body_handler_set_size(body_handler, linphone_content_get_size(content));
|
||||
for (const auto ¶m : contentType.getParameters()) {
|
||||
sal_body_handler_set_content_type_parameter(body_handler, param.getName().c_str(), param.getValue().c_str());
|
||||
}
|
||||
if (content->encoding) sal_body_handler_set_encoding(body_handler, linphone_content_get_encoding(content));
|
||||
sal_body_handler_set_type(body_handler, contentType.getType().c_str());
|
||||
sal_body_handler_set_subtype(body_handler, contentType.getSubType().c_str());
|
||||
sal_body_handler_set_size(body_handler, linphone_content_get_size(content));
|
||||
for (const auto ¶m : contentType.getParameters()) {
|
||||
sal_body_handler_set_content_type_parameter(body_handler, param.getName().c_str(), param.getValue().c_str());
|
||||
}
|
||||
if (content->encoding) sal_body_handler_set_encoding(body_handler, linphone_content_get_encoding(content));
|
||||
|
||||
return body_handler;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue