Fix external body url handling.

This commit is contained in:
Ghislain MARY 2018-04-20 11:52:59 +02:00
parent 38c8ea534a
commit ae3caf72f2
3 changed files with 7 additions and 3 deletions

View file

@ -608,7 +608,9 @@ LinphoneReason ChatMessagePrivate::receive () {
if (errorCode <= 0) {
bool foundSupportContentType = false;
for (Content *c : contents) {
if (linphone_core_is_content_type_supported(core->getCCore(), c->getContentType().asString().c_str())) {
ContentType ct(c->getContentType());
ct.cleanParameters();
if (linphone_core_is_content_type_supported(core->getCCore(), ct.asString().c_str())) {
foundSupportContentType = true;
break;
} else

View file

@ -194,7 +194,7 @@ LinphoneReason ChatRoomPrivate::onSipMessageReceived (SalOp *op, const SalMessag
);
Content content;
if (message->url && (ContentType(message->content_type) == ContentType::ExternalBody)) {
if (message->url && (ContentType(message->content_type).weakEqual(ContentType::ExternalBody))) {
lInfo() << "Received a message with an external body URL " << message->url;
content.setContentType(ContentType::FileTransfer);
content.setBody(msg->getPrivate()->createFakeFileTransferFromUrl(message->url));

View file

@ -43,7 +43,9 @@ public:
// -----------------------------------------------------------------------------
FileTransferContent::FileTransferContent () : Content(*new FileTransferContentPrivate) {}
FileTransferContent::FileTransferContent () : Content(*new FileTransferContentPrivate) {
setContentType(ContentType::FileTransfer);
}
FileTransferContent::FileTransferContent (const FileTransferContent &other) : Content(*new FileTransferContentPrivate) {
L_D();