Commit 57b2d9e6 authored by jehan's avatar jehan

preserve backward compatibility with limev2 early access

parent cc1f38ef
......@@ -293,7 +293,9 @@ ChatMessageModifier::Result LimeX3dhEncryptionEngine::processOutgoingMessage (
// Insert protocol param before boundary for flexisip
ContentType contentType(finalContent.getContentType());
contentType.removeParameter("boundary");
contentType.addParameter("protocol", "\"application/lime\"");
if (!linphone_config_get_bool(linphone_core_get_config(message->getCore()->getCCore()), "lime", "preserve_backward_compatibility",FALSE)) {
contentType.addParameter("protocol", "\"application/lime\"");
}
contentType.addParameter("boundary", MultipartBoundary);
finalContent.setContentType(contentType);
......@@ -338,8 +340,10 @@ ChatMessageModifier::Result LimeX3dhEncryptionEngine::processIncomingMessage (
ContentType expectedContentType = ContentType::Encrypted;
expectedContentType.addParameter("protocol", "\"application/lime\"");
expectedContentType.addParameter("boundary", MultipartBoundary);
ContentType legacyContentType = ContentType::Encrypted; //for backward compatibility with limev2 early access
legacyContentType.addParameter("boundary", MultipartBoundary);
if (incomingContentType != expectedContentType) {
if (incomingContentType != expectedContentType && incomingContentType != legacyContentType) {
lError() << "LIME X3DH unexpected content-type: " << incomingContentType;
// Set unencrypted content warning flag because incoming message type is unexpected
message->getPrivate()->setUnencryptedContentWarning(true);
......
......@@ -1162,6 +1162,12 @@ void MainDbPrivate::updateSchema () {
" LEFT JOIN conference_subject_event ON conference_subject_event.event_id = event.id"
" LEFT JOIN conference_security_event ON conference_security_event.event_id = event.id";
}
if (version < makeVersion(1, 0, 6)
&& linphone_config_get_bool(linphone_core_get_config(q->getCore()->getCCore()), "lime", "migrate_to_secured_room",FALSE)) {
*session << "UPDATE chat_room "
"SET capabilities = capabilities | " + Utils::toString(int(ChatRoom::Capabilities::Encrypted));
}
if (version < makeVersion(1, 0, 7)) {
*session << "ALTER TABLE chat_room_participant_device ADD COLUMN name VARCHAR(255)";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment