Commit 9b7dab62 authored by Nicolas Michon's avatar Nicolas Michon

Set chatroom backend automatically on encryption enablement

parent f0ff75ab
......@@ -58,6 +58,7 @@ void ChatRoomParams::setEncrypted(bool encrypted) {
mEncrypted = encrypted;
if (encrypted) {
mChatRoomEncryptionBackend = ChatRoomEncryptionBackend::Lime;
mChatRoomBackend = ChatRoomBackend::FlexisipChat;
}
}
......
......@@ -421,7 +421,7 @@ static void group_chat_room_params (void) {
linphone_chat_room_params_enable_encryption(params, FALSE);
linphone_chat_room_params_set_backend(params, LinphoneChatRoomBackendBasic);
linphone_chat_room_params_enable_group(params, FALSE);
linphone_chat_room_params_ref(params); //Ref params instead of re-creating them
linphone_chat_room_params_ref(params); //Ref params instead of re-creating them
marieCr = linphone_core_create_chat_room_2(marie->lc, params, "Basic chat room subject", participantsAddresses);
BC_ASSERT_PTR_NOT_NULL(marieCr);
if (marieCr) {
......@@ -482,6 +482,11 @@ static void group_chat_room_params (void) {
marieCr = linphone_core_create_chat_room_2(marie->lc, params, "Invalid chat room subject", NULL);
BC_ASSERT_PTR_NULL(marieCr);
//Should set FlexisipChat as backend if encryption is enabled.
linphone_chat_room_params_set_backend(params, LinphoneChatRoomBackendBasic);
linphone_chat_room_params_enable_encryption(params, TRUE);
BC_ASSERT_EQUAL(linphone_chat_room_params_get_backend(params), LinphoneChatRoomBackendFlexisipChat, int, "%d");
//Cleanup
linphone_chat_room_params_unref(params);
bctbx_list_free_with_data(participantsAddresses, (bctbx_list_free_func)linphone_address_unref);
......
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