mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 05:38:14 +00:00
Merge remote-tracking branch 'origin/dev_content_cpp' into dev_chatroom_list_subscription
This commit is contained in:
commit
951ead79c2
4 changed files with 14 additions and 6 deletions
|
|
@ -962,7 +962,7 @@ void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, Lin
|
|||
const char *subtype = linphone_content_get_subtype(body);
|
||||
|
||||
if ((strcmp(type, "multipart") != 0) || (strcmp(subtype, "related") != 0)) {
|
||||
ms_warning("multipart presence notified but it is not 'multipart/related'");
|
||||
ms_warning("multipart presence notified but it is not 'multipart/related', instead is '%s/%s'", type, subtype);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -741,7 +741,7 @@ void ChatMessagePrivate::send () {
|
|||
|
||||
auto msgOp = dynamic_cast<SalMessageOpInterface *>(op);
|
||||
if (!externalBodyUrl.empty()) {
|
||||
char *content_type = ms_strdup_printf("message/external-body; access-type=URL; URL=\"%s\"", externalBodyUrl.c_str());
|
||||
char *content_type = ms_strdup_printf("message/external-body;access-type=URL;URL=\"%s\"", externalBodyUrl.c_str());
|
||||
msgOp->send_message(content_type, NULL);
|
||||
ms_free(content_type);
|
||||
} else if (internalContent.getContentType().isValid()) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ ContentType::ContentType (const string &contentType) : Header(*new ContentTypePr
|
|||
token = params.substr(0, posParam);
|
||||
}
|
||||
addParameter(HeaderParam(token));
|
||||
params.erase(0, pos + 1);
|
||||
params.erase(0, posParam + 1);
|
||||
} while (posParam != std::string::npos);
|
||||
}
|
||||
}
|
||||
|
|
@ -131,8 +131,7 @@ ContentType &ContentType::operator= (const ContentType &other) {
|
|||
|
||||
bool ContentType::operator== (const ContentType &other) const {
|
||||
return getType() == other.getType() &&
|
||||
getSubType() == other.getSubType() &&
|
||||
getParameters() == other.getParameters();
|
||||
getSubType() == other.getSubType();
|
||||
}
|
||||
|
||||
bool ContentType::operator!= (const ContentType &other) const {
|
||||
|
|
|
|||
|
|
@ -352,9 +352,18 @@ void list_to_multipart () {
|
|||
BC_ASSERT_TRUE(originalStr == generatedStr);
|
||||
}
|
||||
|
||||
static void content_type_parsing(void) {
|
||||
const string type = "message/external-body;access-type=URL;URL=\"https://www.linphone.org/img/linphone-open-source-voip-projectX2.png\"";
|
||||
ContentType contentType = ContentType(type);
|
||||
BC_ASSERT_STRING_EQUAL("message", contentType.getType().c_str());
|
||||
BC_ASSERT_STRING_EQUAL("external-body", contentType.getSubType().c_str());
|
||||
BC_ASSERT_TRUE(type == contentType.asString());
|
||||
}
|
||||
|
||||
test_t content_manager_tests[] = {
|
||||
TEST_NO_TAG("Multipart to list", multipart_to_list),
|
||||
TEST_NO_TAG("List to multipart", list_to_multipart)
|
||||
TEST_NO_TAG("List to multipart", list_to_multipart),
|
||||
TEST_NO_TAG("Content type parsing", content_type_parsing)
|
||||
};
|
||||
|
||||
test_suite_t content_manager_test_suite = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue