From ee077ae5ad25ae6559899317422e335dea600394 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 23 Jan 2017 17:59:32 +0100 Subject: [PATCH] Fix bug where IMDN messages gets encryption by LIME and the other party then treat the decrypted message as plain text. --- coreapi/chat.c | 2 +- coreapi/lime.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 001978494..b4f7c78dc 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -554,7 +554,7 @@ LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const } } - if (retval < 0 && strcmp("text/plain", msg->content_type) != 0 && strcmp("message/external-body", msg->content_type) != 0 + if (retval <= 0 && strcmp("text/plain", msg->content_type) != 0 && strcmp("message/external-body", msg->content_type) != 0 && strcmp("application/vnd.gsma.rcs-ft-http+xml", msg->content_type) != 0) { retval = 415; ms_error("Unsupported MESSAGE (content-type %s not recognized)", msg->content_type); diff --git a/coreapi/lime.c b/coreapi/lime.c index 53c18630a..7315323c7 100644 --- a/coreapi/lime.c +++ b/coreapi/lime.c @@ -952,6 +952,9 @@ int lime_im_encryption_engine_process_outgoing_message_cb(LinphoneImEncryptionEn } else if (strcmp(msg->content_type, "application/im-iscomposing+xml") == 0) { /* We don't encrypt composing messages */ return errcode; + } else if (strcmp(msg->content_type, "message/imdn+xml") == 0) { + /* We don't encrypt imdn messages */ + return errcode; } } msg->content_type = ms_strdup(content_type);