Commit dfbf97d7 authored by Nicolas Michon's avatar Nicolas Michon

Fix crash in test due to specs changes

parent 4e6d6d87
......@@ -1584,9 +1584,13 @@ void linphone_proxy_config_set_conference_factory_uri(LinphoneProxyConfig *cfg,
bctbx_free(cfg->conference_factory_uri);
cfg->conference_factory_uri = nullptr;
}
if (uri) {
if (uri && strlen(uri) > 0) {
cfg->conference_factory_uri = bctbx_strdup(uri);
linphone_core_add_linphone_spec(cfg->lc, "groupchat");
if (cfg->lc) {
linphone_core_add_linphone_spec(cfg->lc, "groupchat");
}
} else if (cfg->lc) {
linphone_core_remove_linphone_spec(cfg->lc, "groupchat");
}
}
......
......@@ -296,11 +296,10 @@ void Core::setSpecsList (const std::list<std::string> &specsList) {
L_D();
d->specs = specsList;
d->specs.unique();
const string tmpSpecs = getSpecs();
const string &tmpSpecs = getSpecs();
LinphoneConfig *lpconfig = linphone_core_get_config(getCCore());
linphone_config_set_string(lpconfig, "sip", "linphone_specs", tmpSpecs.c_str());
getCCore()->sal->setContactLinphoneSpecs(tmpSpecs);
//lInfo() << "DEBUG SETTING LINPHONE SPECS LIST::::: [" << tmpSpecs << "]" << d->specs.size() << std::endl;
}
void Core::addSpec (const std::string &spec) {
......@@ -313,7 +312,6 @@ void Core::removeSpec(const std::string &pSpec) {
L_D();
d->specs.remove_if([&pSpec](const std::string &spec) { return spec.compare(pSpec) == 0; });
setSpecsList(d->specs);
}
const std::list<std::string> &Core::getSpecsList () const {
......@@ -321,7 +319,7 @@ const std::list<std::string> &Core::getSpecsList () const {
return d->specs;
}
//Used to set specs from linphone_config
//Used to set specs for linphone_config
void Core::setSpecs (const std::string &pSpecs) {
L_D();
if (pSpecs.empty()) {
......
......@@ -107,7 +107,7 @@ static void group_chat_lime_x3dh_change_server_url(void) {
wait_for_list(coresList, &dummy, 1, x3dhServerDelay);
//Now create an encrypted chatroom to check that marie can
// Marie creates an encrypted chatroom
//Marie creates an encrypted chatroom
const char *initialSubject = "Encrypted Friends";
participantsAddresses = bctbx_list_append(NULL, linphone_address_new(linphone_core_get_identity(pauline->lc)));
marieEncryptedCr = create_chat_room_client_side(coresList, marie, &initialMarieStats, participantsAddresses, initialSubject, TRUE);
......@@ -512,6 +512,8 @@ static void group_chat_lime_x3dh_encrypted_message_to_devices_with_and_without_k
int dummy = 0;
linphone_core_enable_lime_x3dh(laure->lc, FALSE);
linphone_core_add_linphone_spec(laure->lc, "lime"); //Forcing lime_x3dh spec even if encryption engine is disabled
bctbx_list_t *coresList = init_core_for_conference(coresManagerList);
start_core_for_conference(coresManagerList);
participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(pauline->lc)));
......@@ -528,6 +530,7 @@ static void group_chat_lime_x3dh_encrypted_message_to_devices_with_and_without_k
BC_ASSERT_TRUE(linphone_core_lime_x3dh_enabled(pauline->lc));
BC_ASSERT_FALSE(linphone_core_lime_x3dh_enabled(laure->lc));
// Marie creates a new group chat room
const char *initialSubject = "Friends";
LinphoneChatRoom *marieCr = create_chat_room_client_side(coresList, marie, &initialMarieStats, participantsAddresses, initialSubject, TRUE);
......
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